#include "satellite-point-to-point-isl-net-device.h"
Public Member Functions | |
PointToPointIslNetDevice () | |
Construct a PointToPointIslNetDevice. More... | |
virtual | ~PointToPointIslNetDevice () |
Destroy a PointToPointIslNetDevice. More... | |
virtual void | AddLinkChangeCallback (Callback< void > callback) |
bool | Attach (Ptr< PointToPointIslChannel > ch) |
Attach the device to a channel. More... | |
virtual Address | GetAddress (void) const |
virtual Address | GetBroadcast (void) const |
virtual Ptr< Channel > | GetChannel (void) const |
virtual Ptr< Node > | GetDestinationNode (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 |
Ptr< DropTailQueue< Packet > > | GetQueue (void) const |
Get a copy of the attached Queue. More... | |
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 > p) |
Receive a packet from a connected PointToPointIslChannel. 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 | SetDataRate (DataRate bps) |
Set the Data Rate used for transmission of packets. More... | |
virtual void | SetDestinationNode (Ptr< Node > node) |
virtual void | SetIfIndex (const uint32_t index) |
void | SetInterframeGap (Time t) |
Set the interframe gap used to separate packets. More... | |
virtual bool | SetMtu (const uint16_t mtu) |
virtual void | SetNode (Ptr< Node > node) |
void | SetOrbiterNetDevice (Ptr< SatOrbiterNetDevice > orbiterNetDevice) |
Set the associated OrbiterNetDevice. More... | |
virtual void | SetPromiscReceiveCallback (PromiscReceiveCallback cb) |
void | SetQueue (Ptr< DropTailQueue< Packet >> queue) |
Attach a queue to the PointToPointIslNetDevice. More... | |
virtual void | SetReceiveCallback (NetDevice::ReceiveCallback cb) |
void | SetReceiveErrorModel (Ptr< ErrorModel > em) |
Attach a receive ErrorModel to the PointToPointIslNetDevice. More... | |
virtual bool | SupportsSendFrom (void) const |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the TypeId. More... | |
Private Types | |
enum | TxMachineState { READY , BUSY } |
Enumeration of the states of the transmit machine of the net device. More... | |
Private Member Functions | |
PointToPointIslNetDevice (const PointToPointIslNetDevice &o) | |
Copy constructor. More... | |
void | AddHeader (Ptr< Packet > p, uint16_t protocolNumber) |
Adds the necessary headers and trailers to a packet of data in order to respect the protocol implemented by the agent. More... | |
virtual void | DoDispose (void) |
Dispose of the object. More... | |
Address | GetRemote (void) const |
void | NotifyLinkUp (void) |
Make the link up and running. More... | |
PointToPointIslNetDevice & | operator= (const PointToPointIslNetDevice &o) |
Assign operator. More... | |
bool | ProcessHeader (Ptr< Packet > p, uint16_t ¶m) |
Removes, from a packet of data, all headers and trailers that relate to the protocol implemented by the agent. More... | |
void | TransmitComplete (void) |
Stop Sending a Packet Down the Wire and Begin the Interframe Gap. More... | |
bool | TransmitStart (Ptr< Packet > p) |
Start Sending a Packet Down the Wire. More... | |
Static Private Member Functions | |
static uint16_t | EtherToPpp (uint16_t protocol) |
Ethernet to PPP protocol number mapping. More... | |
static uint16_t | PppToEther (uint16_t protocol) |
PPP to Ethernet protocol number mapping. More... | |
Private Attributes | |
Mac48Address | m_address |
Mac48Address of this NetDevice. More... | |
Ptr< PointToPointIslChannel > | m_channel |
The PointToPointIslChannel to which this PointToPointIslNetDevice has been attached. More... | |
Ptr< Packet > | m_currentPkt |
Current packet processed. More... | |
DataRate | m_dataRate |
The data rate that the Net Device uses to simulate packet transmission timing. More... | |
Ptr< Node > | m_destinationNode |
Node at the other end of the p2pIslLink. More... | |
uint32_t | m_ifIndex |
Index of the interface. More... | |
bool | m_linkUp |
Identify if the link is up or not. More... | |
uint32_t | m_mtu |
The Maximum Transmission Unit. More... | |
Ptr< Node > | m_node |
Node owning this NetDevice. More... | |
Ptr< SatOrbiterNetDevice > | m_orbiterNetDevice |
Satellite Orbiter Net Device associated to this instance. More... | |
TracedCallback< uint32_t, Ptr< Node >, Ptr< Node >, bool > | m_packetDropRateTrace |
Traced callback for drop rate in queue. More... | |
NetDevice::PromiscReceiveCallback | m_promiscCallback |
Receive callback. More... | |
Ptr< DropTailQueue< Packet > > | m_queue |
The Queue which this PointToPointIslNetDevice uses as a packet source. More... | |
Ptr< ErrorModel > | m_receiveErrorModel |
Error model for receive packet events. More... | |
NetDevice::ReceiveCallback | m_rxCallback |
Receive callback. More... | |
Time | m_tInterframeGap |
The interframe gap that the Net Device uses to throttle packet transmission. More... | |
TxMachineState | m_txMachineState |
The state of the Net Device transmit state machine. More... | |
Static Private Attributes | |
static const uint16_t | DEFAULT_MTU = 1500 |
Default MTU. More... | |
Definition at line 66 of file satellite-point-to-point-isl-net-device.h.
|
private |
Enumeration of the states of the transmit machine of the net device.
Enumerator | |
---|---|
READY | The transmitter is ready to begin transmission of a packet. |
BUSY | The transmitter is busy transmitting a packet. |
Definition at line 291 of file satellite-point-to-point-isl-net-device.h.
ns3::PointToPointIslNetDevice::PointToPointIslNetDevice | ( | ) |
Construct a PointToPointIslNetDevice.
This is the constructor for the PointToPointIslNetDevice
Definition at line 74 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Destroy a PointToPointIslNetDevice.
This is the destructor for the PointToPointIslNetDevice.
Definition at line 83 of file satellite-point-to-point-isl-net-device.cc.
|
private |
Copy constructor.
The method is private, so it is DISABLED.
o | Other NetDevice |
|
private |
Adds the necessary headers and trailers to a packet of data in order to respect the protocol implemented by the agent.
p | packet |
protocolNumber | protocol number |
Definition at line 89 of file satellite-point-to-point-isl-net-device.cc.
References EtherToPpp().
Referenced by Send().
|
virtual |
Definition at line 338 of file satellite-point-to-point-isl-net-device.cc.
bool ns3::PointToPointIslNetDevice::Attach | ( | Ptr< PointToPointIslChannel > | ch | ) |
Attach the device to a channel.
ch | Ptr to the channel to which this object is being attached. |
Definition at line 188 of file satellite-point-to-point-isl-net-device.cc.
References m_channel, and NotifyLinkUp().
|
privatevirtual |
Dispose of the object.
Definition at line 108 of file satellite-point-to-point-isl-net-device.cc.
References m_channel, m_currentPkt, m_node, m_queue, and m_receiveErrorModel.
|
staticprivate |
Ethernet to PPP protocol number mapping.
protocol | An Ethernet protocol number |
Definition at line 539 of file satellite-point-to-point-isl-net-device.cc.
Referenced by AddHeader().
|
virtual |
Definition at line 312 of file satellite-point-to-point-isl-net-device.cc.
References m_address.
Referenced by Receive().
|
virtual |
Definition at line 360 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 293 of file satellite-point-to-point-isl-net-device.cc.
References m_channel.
|
virtual |
Definition at line 325 of file satellite-point-to-point-isl-net-device.cc.
References m_destinationNode.
|
virtual |
Definition at line 287 of file satellite-point-to-point-isl-net-device.cc.
References m_ifIndex.
|
virtual |
Definition at line 516 of file satellite-point-to-point-isl-net-device.cc.
References m_mtu.
|
virtual |
Definition at line 374 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 381 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 451 of file satellite-point-to-point-isl-net-device.cc.
References m_node.
Ptr< DropTailQueue< Packet > > ns3::PointToPointIslNetDevice::GetQueue | ( | void | ) | const |
Get a copy of the attached Queue.
Definition at line 266 of file satellite-point-to-point-isl-net-device.cc.
References m_queue.
|
private |
Definition at line 490 of file satellite-point-to-point-isl-net-device.cc.
References m_channel.
Referenced by Receive().
|
static |
Get the TypeId.
Definition at line 50 of file satellite-point-to-point-isl-net-device.cc.
References m_packetDropRateTrace, m_receiveErrorModel, and m_tInterframeGap.
|
virtual |
Definition at line 395 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 348 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 331 of file satellite-point-to-point-isl-net-device.cc.
References m_linkUp.
Referenced by Send().
|
virtual |
Definition at line 367 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 388 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 464 of file satellite-point-to-point-isl-net-device.cc.
|
private |
Make the link up and running.
It calls also the linkChange callback.
Definition at line 273 of file satellite-point-to-point-isl-net-device.cc.
References m_linkUp.
Referenced by Attach().
|
private |
Assign operator.
The method is private, so it is DISABLED.
o | Other NetDevice |
|
staticprivate |
PPP to Ethernet protocol number mapping.
protocol | A PPP protocol number |
Definition at line 523 of file satellite-point-to-point-isl-net-device.cc.
Referenced by ProcessHeader().
|
private |
Removes, from a packet of data, all headers and trailers that relate to the protocol implemented by the agent.
p | Packet whose headers need to be processed |
param | An integer parameter that can be set by the function |
Definition at line 98 of file satellite-point-to-point-isl-net-device.cc.
References PppToEther().
Referenced by Receive().
void ns3::PointToPointIslNetDevice::Receive | ( | Ptr< Packet > | p | ) |
Receive a packet from a connected PointToPointIslChannel.
The PointToPointIslNetDevice receives packets from its connected channel and forwards them up the protocol stack. This is the public method used by the channel to indicate that the last bit of a packet has arrived at the device.
p | Ptr to the received packet. |
Definition at line 220 of file satellite-point-to-point-isl-net-device.cc.
References GetAddress(), ns3::SatGroundStationAddressTag::GetGroundStationAddress(), GetRemote(), m_orbiterNetDevice, m_promiscCallback, m_receiveErrorModel, and ProcessHeader().
Referenced by ns3::PointToPointIslChannel::TransmitStart().
|
virtual |
Definition at line 402 of file satellite-point-to-point-isl-net-device.cc.
References AddHeader(), IsLinkUp(), m_destinationNode, m_node, m_packetDropRateTrace, m_queue, m_txMachineState, READY, and TransmitStart().
|
virtual |
Definition at line 441 of file satellite-point-to-point-isl-net-device.cc.
|
virtual |
Definition at line 305 of file satellite-point-to-point-isl-net-device.cc.
References m_address.
Referenced by ns3::PointToPointIslHelper::Install().
void ns3::PointToPointIslNetDevice::SetDataRate | ( | DataRate | bps | ) |
Set the Data Rate used for transmission of packets.
The data rate is set in the Attach () method from the corresponding field in the channel to which the device is attached. It can be overridden using this method.
bps | the data rate at which this object operates |
Definition at line 120 of file satellite-point-to-point-isl-net-device.cc.
References m_dataRate.
|
virtual |
Definition at line 318 of file satellite-point-to-point-isl-net-device.cc.
References m_destinationNode.
|
virtual |
Definition at line 280 of file satellite-point-to-point-isl-net-device.cc.
References m_ifIndex.
void ns3::PointToPointIslNetDevice::SetInterframeGap | ( | Time | t | ) |
Set the interframe gap used to separate packets.
The interframe gap defines the minimum space required between packets sent by this device.
t | the interframe gap time |
Definition at line 127 of file satellite-point-to-point-isl-net-device.cc.
References m_tInterframeGap.
|
virtual |
Definition at line 508 of file satellite-point-to-point-isl-net-device.cc.
References m_mtu.
|
virtual |
Definition at line 457 of file satellite-point-to-point-isl-net-device.cc.
References m_node.
void ns3::PointToPointIslNetDevice::SetOrbiterNetDevice | ( | Ptr< SatOrbiterNetDevice > | orbiterNetDevice | ) |
Set the associated OrbiterNetDevice.
orbiterNetDevice | The device to attach to this instance |
Definition at line 258 of file satellite-point-to-point-isl-net-device.cc.
References m_orbiterNetDevice.
|
virtual |
Definition at line 477 of file satellite-point-to-point-isl-net-device.cc.
References m_promiscCallback.
void ns3::PointToPointIslNetDevice::SetQueue | ( | Ptr< DropTailQueue< Packet >> | queue | ) |
Attach a queue to the PointToPointIslNetDevice.
The PointToPointIslNetDevice "owns" a queue that implements a queueing method such as DropTailQueue or RedQueue
queue | Ptr to the new queue. |
Definition at line 206 of file satellite-point-to-point-isl-net-device.cc.
References m_queue.
|
virtual |
Definition at line 471 of file satellite-point-to-point-isl-net-device.cc.
References m_rxCallback.
void ns3::PointToPointIslNetDevice::SetReceiveErrorModel | ( | Ptr< ErrorModel > | em | ) |
Attach a receive ErrorModel to the PointToPointIslNetDevice.
The PointToPointNetLaserDevice may optionally include an ErrorModel in the packet receive chain.
em | Ptr to the ErrorModel. |
Definition at line 213 of file satellite-point-to-point-isl-net-device.cc.
References m_receiveErrorModel.
|
virtual |
Definition at line 483 of file satellite-point-to-point-isl-net-device.cc.
|
private |
Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
The TransmitComplete method is used internally to finish the process of sending a packet out on the channel.
Definition at line 159 of file satellite-point-to-point-isl-net-device.cc.
References BUSY, m_currentPkt, m_queue, m_txMachineState, READY, and TransmitStart().
Referenced by TransmitStart().
|
private |
Start Sending a Packet Down the Wire.
The TransmitStart method is the method that is used internally in the PointToPointIslNetDevice to begin the process of sending a packet out on the channel. The corresponding method is called on the channel to let it know that the physical device this class represents has virtually started sending signals. An event is scheduled for the time at which the bits have been completely transmitted.
p | a reference to the packet to send |
Definition at line 134 of file satellite-point-to-point-isl-net-device.cc.
References BUSY, m_channel, m_currentPkt, m_dataRate, m_destinationNode, m_tInterframeGap, m_txMachineState, READY, and TransmitComplete().
Referenced by Send(), and TransmitComplete().
|
staticprivate |
Default MTU.
Definition at line 297 of file satellite-point-to-point-isl-net-device.h.
|
private |
Mac48Address of this NetDevice.
Definition at line 313 of file satellite-point-to-point-isl-net-device.h.
Referenced by GetAddress(), and SetAddress().
|
private |
The PointToPointIslChannel to which this PointToPointIslNetDevice has been attached.
Definition at line 304 of file satellite-point-to-point-isl-net-device.h.
Referenced by Attach(), DoDispose(), GetChannel(), GetRemote(), and TransmitStart().
|
private |
Current packet processed.
Definition at line 320 of file satellite-point-to-point-isl-net-device.h.
Referenced by DoDispose(), TransmitComplete(), and TransmitStart().
|
private |
The data rate that the Net Device uses to simulate packet transmission timing.
Definition at line 300 of file satellite-point-to-point-isl-net-device.h.
Referenced by SetDataRate(), and TransmitStart().
|
private |
Node at the other end of the p2pIslLink.
Definition at line 312 of file satellite-point-to-point-isl-net-device.h.
Referenced by GetDestinationNode(), Send(), SetDestinationNode(), and TransmitStart().
|
private |
Index of the interface.
Definition at line 317 of file satellite-point-to-point-isl-net-device.h.
Referenced by GetIfIndex(), and SetIfIndex().
|
private |
Identify if the link is up or not.
Definition at line 318 of file satellite-point-to-point-isl-net-device.h.
Referenced by IsLinkUp(), and NotifyLinkUp().
|
private |
The Maximum Transmission Unit.
Definition at line 319 of file satellite-point-to-point-isl-net-device.h.
|
private |
Node owning this NetDevice.
Definition at line 311 of file satellite-point-to-point-isl-net-device.h.
Referenced by DoDispose(), GetNode(), Send(), and SetNode().
|
private |
Satellite Orbiter Net Device associated to this instance.
Definition at line 323 of file satellite-point-to-point-isl-net-device.h.
Referenced by Receive(), and SetOrbiterNetDevice().
|
private |
Traced callback for drop rate in queue.
Definition at line 342 of file satellite-point-to-point-isl-net-device.h.
Referenced by GetTypeId(), and Send().
|
private |
Receive callback.
Definition at line 315 of file satellite-point-to-point-isl-net-device.h.
Referenced by Receive(), and SetPromiscReceiveCallback().
|
private |
The Queue which this PointToPointIslNetDevice uses as a packet source.
Definition at line 307 of file satellite-point-to-point-isl-net-device.h.
Referenced by DoDispose(), GetQueue(), Send(), SetQueue(), and TransmitComplete().
|
private |
Error model for receive packet events.
Definition at line 310 of file satellite-point-to-point-isl-net-device.h.
Referenced by DoDispose(), GetTypeId(), Receive(), and SetReceiveErrorModel().
|
private |
Receive callback.
Definition at line 314 of file satellite-point-to-point-isl-net-device.h.
Referenced by SetReceiveCallback().
|
private |
The interframe gap that the Net Device uses to throttle packet transmission.
Definition at line 302 of file satellite-point-to-point-isl-net-device.h.
Referenced by GetTypeId(), SetInterframeGap(), and TransmitStart().
|
private |
The state of the Net Device transmit state machine.
Definition at line 299 of file satellite-point-to-point-isl-net-device.h.
Referenced by Send(), TransmitComplete(), and TransmitStart().