Satellite simple net device for satellite public and backbone network use. More...
#include "satellite-simple-net-device.h"
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< SatSimpleChannel > | m_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 |
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 50 of file satellite-simple-net-device.h.
ns3::SatSimpleNetDevice::SatSimpleNetDevice | ( | ) |
Default constructor.
Definition at line 61 of file satellite-simple-net-device.cc.
ns3::SatSimpleNetDevice::~SatSimpleNetDevice | ( | ) |
Destructor for SatSimpleNetDevice.
Definition at line 70 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 195 of file satellite-simple-net-device.cc.
|
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.
|
virtual |
Definition at line 163 of file satellite-simple-net-device.cc.
References m_address.
|
virtual |
Definition at line 208 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 149 of file satellite-simple-net-device.cc.
References m_channel.
|
virtual |
Definition at line 142 of file satellite-simple-net-device.cc.
References m_ifIndex.
|
virtual |
Definition at line 181 of file satellite-simple-net-device.cc.
References m_mtu.
Referenced by GetTypeId().
|
virtual |
Definition at line 222 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 229 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 272 of file satellite-simple-net-device.cc.
References m_node.
|
static |
Get the type ID.
Definition at line 36 of file satellite-simple-net-device.cc.
References GetMtu(), m_phyRxDropTrace, m_receiveErrorModel, and SetMtu().
|
virtual |
Definition at line 243 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 201 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 188 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 215 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 236 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 286 of file satellite-simple-net-device.cc.
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
packet | Packet received on the channel |
protocol | protocol number |
to | address packet should be sent to |
from | address 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().
|
virtual |
Definition at line 250 of file satellite-simple-net-device.cc.
|
virtual |
Definition at line 259 of file satellite-simple-net-device.cc.
References m_channel.
|
virtual |
Definition at line 156 of file satellite-simple-net-device.cc.
References m_address.
void ns3::SatSimpleNetDevice::SetChannel | ( | Ptr< SatSimpleChannel > | channel | ) |
Attach a channel to this net device.
This will be the channel the net device sends on
channel | channel to assign to this net device |
Definition at line 120 of file satellite-simple-net-device.cc.
References m_channel.
|
virtual |
Definition at line 135 of file satellite-simple-net-device.cc.
References m_ifIndex.
|
virtual |
Definition at line 173 of file satellite-simple-net-device.cc.
References m_mtu.
Referenced by GetTypeId().
|
virtual |
Definition at line 279 of file satellite-simple-net-device.cc.
References m_node.
|
virtual |
Definition at line 310 of file satellite-simple-net-device.cc.
References m_promiscCallback.
|
virtual |
Definition at line 293 of file satellite-simple-net-device.cc.
References m_rxCallback.
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.
em | Ptr to the ErrorModel. |
Definition at line 128 of file satellite-simple-net-device.cc.
References m_receiveErrorModel.
|
virtual |
Definition at line 317 of file satellite-simple-net-device.cc.
|
private |
Definition at line 146 of file satellite-simple-net-device.h.
Referenced by GetAddress(), Receive(), Send(), and SetAddress().
|
private |
Definition at line 140 of file satellite-simple-net-device.h.
Referenced by DoDispose(), GetChannel(), Send(), SendFrom(), and SetChannel().
|
private |
Definition at line 145 of file satellite-simple-net-device.h.
Referenced by GetIfIndex(), and SetIfIndex().
|
private |
Definition at line 144 of file satellite-simple-net-device.h.
|
private |
Definition at line 143 of file satellite-simple-net-device.h.
Referenced by DoDispose(), GetNode(), and SetNode().
|
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.
Definition at line 156 of file satellite-simple-net-device.h.
Referenced by GetTypeId(), and Receive().
|
private |
Definition at line 142 of file satellite-simple-net-device.h.
Referenced by Receive(), and SetPromiscReceiveCallback().
|
private |
Definition at line 147 of file satellite-simple-net-device.h.
Referenced by DoDispose(), GetTypeId(), Receive(), and SetReceiveErrorModel().
|
private |
Definition at line 141 of file satellite-simple-net-device.h.
Referenced by Receive(), and SetReceiveCallback().