ns3::SatSimpleNetDevice Class Reference

Satellite simple net device for satellite public and backbone network use. More...

#include "satellite-simple-net-device.h"

+ Inheritance diagram for ns3::SatSimpleNetDevice:
+ Collaboration diagram for ns3::SatSimpleNetDevice:

Public Member Functions

 SatSimpleNetDevice ()
 Default constructor. More...
 
 ~SatSimpleNetDevice ()
 Destructor for SatSimpleNetDevice. More...
 
virtual void AddLinkChangeCallback (Callback< void > callback)
 
virtual Address GetAddress (void) const
 
virtual Address GetBroadcast (void) const
 
virtual Ptr< Channel > GetChannel (void) const
 
virtual uint32_t GetIfIndex (void) const
 
virtual uint16_t GetMtu (void) const
 
virtual Address GetMulticast (Ipv4Address multicastGroup) const
 
virtual Address GetMulticast (Ipv6Address addr) const
 
virtual Ptr< Node > GetNode (void) const
 
virtual bool IsBridge (void) const
 
virtual bool IsBroadcast (void) const
 
virtual bool IsLinkUp (void) const
 
virtual bool IsMulticast (void) const
 
virtual bool IsPointToPoint (void) const
 
virtual bool NeedsArp (void) const
 
void Receive (Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
 Receive a packet from a connected SatSimpleChannel. More...
 
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 SetChannel (Ptr< SatSimpleChannel > channel)
 Attach a channel to this net device. More...
 
virtual void SetIfIndex (const uint32_t index)
 
virtual bool SetMtu (const uint16_t mtu)
 
virtual void SetNode (Ptr< Node > node)
 
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb)
 
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb)
 
void SetReceiveErrorModel (Ptr< ErrorModel > em)
 Attach a receive ErrorModel to the SimpleNetDevice. More...
 
virtual bool SupportsSendFrom (void) const
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 

Protected Member Functions

virtual void DoDispose (void)
 Dispose of this class instance. More...
 

Private Attributes

Mac48Address m_address
 
Ptr< SatSimpleChannelm_channel
 
uint32_t m_ifIndex
 
uint16_t m_mtu
 
Ptr< Node > m_node
 
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
 The trace source fired when the phy layer drops a packet it has received due to the error model being active. More...
 
NetDevice::PromiscReceiveCallback m_promiscCallback
 
Ptr< ErrorModel > m_receiveErrorModel
 
NetDevice::ReceiveCallback m_rxCallback
 

Detailed Description

Satellite simple net device for satellite public and backbone network use.

This device is based on ns-3 SimpleNetDevice. Main difference is that this device needs ARP and it has multicast. Receive method DO NOT pass packet to upper layer when packet type is PACKET_OTHERHOST.

This device does not have a helper and assumes 48-bit mac addressing; the default address assigned to each device is zero, so you must assign a real address to use it. There is also the possibility to add an ErrorModel, if you want to force losses on the device.

Definition at line 48 of file satellite-simple-net-device.h.

Constructor & Destructor Documentation

◆ SatSimpleNetDevice()

ns3::SatSimpleNetDevice::SatSimpleNetDevice ( )

Default constructor.

Definition at line 61 of file satellite-simple-net-device.cc.

◆ ~SatSimpleNetDevice()

ns3::SatSimpleNetDevice::~SatSimpleNetDevice ( )

Destructor for SatSimpleNetDevice.

Definition at line 70 of file satellite-simple-net-device.cc.

Member Function Documentation

◆ AddLinkChangeCallback()

void ns3::SatSimpleNetDevice::AddLinkChangeCallback ( Callback< void >  callback)
virtual

Definition at line 195 of file satellite-simple-net-device.cc.

◆ DoDispose()

void ns3::SatSimpleNetDevice::DoDispose ( void  )
protectedvirtual

Dispose of this class instance.

Definition at line 300 of file satellite-simple-net-device.cc.

References m_channel, m_node, and m_receiveErrorModel.

◆ GetAddress()

Address ns3::SatSimpleNetDevice::GetAddress ( void  ) const
virtual

Definition at line 163 of file satellite-simple-net-device.cc.

References m_address.

◆ GetBroadcast()

Address ns3::SatSimpleNetDevice::GetBroadcast ( void  ) const
virtual

Definition at line 208 of file satellite-simple-net-device.cc.

◆ GetChannel()

Ptr< Channel > ns3::SatSimpleNetDevice::GetChannel ( void  ) const
virtual

Definition at line 149 of file satellite-simple-net-device.cc.

References m_channel.

◆ GetIfIndex()

uint32_t ns3::SatSimpleNetDevice::GetIfIndex ( void  ) const
virtual

Definition at line 142 of file satellite-simple-net-device.cc.

References m_ifIndex.

◆ GetMtu()

uint16_t ns3::SatSimpleNetDevice::GetMtu ( void  ) const
virtual

Definition at line 181 of file satellite-simple-net-device.cc.

References m_mtu.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetMulticast() [1/2]

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

Definition at line 222 of file satellite-simple-net-device.cc.

◆ GetMulticast() [2/2]

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

Definition at line 229 of file satellite-simple-net-device.cc.

◆ GetNode()

Ptr< Node > ns3::SatSimpleNetDevice::GetNode ( void  ) const
virtual

Definition at line 272 of file satellite-simple-net-device.cc.

References m_node.

◆ GetTypeId()

TypeId ns3::SatSimpleNetDevice::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 36 of file satellite-simple-net-device.cc.

References GetMtu(), m_phyRxDropTrace, m_receiveErrorModel, and SetMtu().

+ Here is the call graph for this function:

◆ IsBridge()

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

Definition at line 243 of file satellite-simple-net-device.cc.

◆ IsBroadcast()

bool ns3::SatSimpleNetDevice::IsBroadcast ( void  ) const
virtual

Definition at line 201 of file satellite-simple-net-device.cc.

◆ IsLinkUp()

bool ns3::SatSimpleNetDevice::IsLinkUp ( void  ) const
virtual

Definition at line 188 of file satellite-simple-net-device.cc.

◆ IsMulticast()

bool ns3::SatSimpleNetDevice::IsMulticast ( void  ) const
virtual

Definition at line 215 of file satellite-simple-net-device.cc.

◆ IsPointToPoint()

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

Definition at line 236 of file satellite-simple-net-device.cc.

◆ NeedsArp()

bool ns3::SatSimpleNetDevice::NeedsArp ( void  ) const
virtual

Definition at line 286 of file satellite-simple-net-device.cc.

◆ Receive()

void ns3::SatSimpleNetDevice::Receive ( Ptr< Packet >  packet,
uint16_t  protocol,
Mac48Address  to,
Mac48Address  from 
)

Receive a packet from a connected SatSimpleChannel.

The SatSimpleNetDevice receives packets from its connected channel and then forwards them by calling its rx callback method

Parameters
packetPacket received on the channel
protocolprotocol number
toaddress packet should be sent to
fromaddress packet was sent from

Definition at line 76 of file satellite-simple-net-device.cc.

References m_address, m_phyRxDropTrace, m_promiscCallback, m_receiveErrorModel, and m_rxCallback.

Referenced by ns3::SatSimpleChannel::Send().

+ Here is the caller graph for this function:

◆ Send()

bool ns3::SatSimpleNetDevice::Send ( Ptr< Packet >  packet,
const Address &  dest,
uint16_t  protocolNumber 
)
virtual

Definition at line 250 of file satellite-simple-net-device.cc.

References m_address, and m_channel.

◆ SendFrom()

bool ns3::SatSimpleNetDevice::SendFrom ( Ptr< Packet >  packet,
const Address &  source,
const Address &  dest,
uint16_t  protocolNumber 
)
virtual

Definition at line 259 of file satellite-simple-net-device.cc.

References m_channel.

◆ SetAddress()

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

Definition at line 156 of file satellite-simple-net-device.cc.

References m_address.

◆ SetChannel()

void ns3::SatSimpleNetDevice::SetChannel ( Ptr< SatSimpleChannel channel)

Attach a channel to this net device.

This will be the channel the net device sends on

Parameters
channelchannel to assign to this net device

Definition at line 120 of file satellite-simple-net-device.cc.

References m_channel.

◆ SetIfIndex()

void ns3::SatSimpleNetDevice::SetIfIndex ( const uint32_t  index)
virtual

Definition at line 135 of file satellite-simple-net-device.cc.

References m_ifIndex.

◆ SetMtu()

bool ns3::SatSimpleNetDevice::SetMtu ( const uint16_t  mtu)
virtual

Definition at line 173 of file satellite-simple-net-device.cc.

References m_mtu.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetNode()

void ns3::SatSimpleNetDevice::SetNode ( Ptr< Node >  node)
virtual

Definition at line 279 of file satellite-simple-net-device.cc.

References m_node.

◆ SetPromiscReceiveCallback()

void ns3::SatSimpleNetDevice::SetPromiscReceiveCallback ( PromiscReceiveCallback  cb)
virtual

Definition at line 310 of file satellite-simple-net-device.cc.

References m_promiscCallback.

◆ SetReceiveCallback()

void ns3::SatSimpleNetDevice::SetReceiveCallback ( NetDevice::ReceiveCallback  cb)
virtual

Definition at line 293 of file satellite-simple-net-device.cc.

References m_rxCallback.

◆ SetReceiveErrorModel()

void ns3::SatSimpleNetDevice::SetReceiveErrorModel ( Ptr< ErrorModel >  em)

Attach a receive ErrorModel to the SimpleNetDevice.

The SimpleNetDevice may optionally include an ErrorModel in the packet receive chain.

See also
ErrorModel
Parameters
emPtr to the ErrorModel.

Definition at line 128 of file satellite-simple-net-device.cc.

References m_receiveErrorModel.

◆ SupportsSendFrom()

bool ns3::SatSimpleNetDevice::SupportsSendFrom ( void  ) const
virtual

Definition at line 317 of file satellite-simple-net-device.cc.

Member Data Documentation

◆ m_address

Mac48Address ns3::SatSimpleNetDevice::m_address
private

Definition at line 144 of file satellite-simple-net-device.h.

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

◆ m_channel

Ptr<SatSimpleChannel> ns3::SatSimpleNetDevice::m_channel
private

Definition at line 138 of file satellite-simple-net-device.h.

Referenced by DoDispose(), GetChannel(), Send(), SendFrom(), and SetChannel().

◆ m_ifIndex

uint32_t ns3::SatSimpleNetDevice::m_ifIndex
private

Definition at line 143 of file satellite-simple-net-device.h.

Referenced by GetIfIndex(), and SetIfIndex().

◆ m_mtu

uint16_t ns3::SatSimpleNetDevice::m_mtu
private

Definition at line 142 of file satellite-simple-net-device.h.

Referenced by GetMtu(), and SetMtu().

◆ m_node

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

Definition at line 141 of file satellite-simple-net-device.h.

Referenced by DoDispose(), GetNode(), and SetNode().

◆ m_phyRxDropTrace

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

The trace source fired when the phy layer drops a packet it has received due to the error model being active.

Although SimpleNetDevice doesn't really have a Phy model, we choose this trace source name for alignment with other trace sources.

See also
class CallBackTraceSource

Definition at line 154 of file satellite-simple-net-device.h.

Referenced by GetTypeId(), and Receive().

◆ m_promiscCallback

NetDevice::PromiscReceiveCallback ns3::SatSimpleNetDevice::m_promiscCallback
private

Definition at line 140 of file satellite-simple-net-device.h.

Referenced by Receive(), and SetPromiscReceiveCallback().

◆ m_receiveErrorModel

Ptr<ErrorModel> ns3::SatSimpleNetDevice::m_receiveErrorModel
private

Definition at line 145 of file satellite-simple-net-device.h.

Referenced by DoDispose(), GetTypeId(), Receive(), and SetReceiveErrorModel().

◆ m_rxCallback

NetDevice::ReceiveCallback ns3::SatSimpleNetDevice::m_rxCallback
private

Definition at line 139 of file satellite-simple-net-device.h.

Referenced by Receive(), and SetReceiveCallback().


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