ns-3
ns3::WimaxNetDevice Class Reference

Hold together all Wimax-related objects in a NetDevice.This class holds together ns3::WimaxPhy, ns3::WimaxConnection, ns3::ConectionManager, ns3::BurstProfileManager, and ns3::BandwidthManager. More...

#include <wimax-net-device.h>

Inheritance diagram for ns3::WimaxNetDevice:
Collaboration diagram for ns3::WimaxNetDevice:

List of all members.

Public Types

enum  Direction { DIRECTION_DOWNLINK, DIRECTION_UPLINK }
enum  RangingStatus { RANGING_STATUS_EXPIRED, RANGING_STATUS_CONTINUE, RANGING_STATUS_ABORT, RANGING_STATUS_SUCCESS }
- 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 & > 
ReceiveCallback
typedef Callback< bool, Ptr
< NetDevice >, Ptr< const
Packet >, uint16_t, const
Address &, const Address
&, enum PacketType
PromiscReceiveCallback

Public Member Functions

void SetTtg (uint16_t ttg)
uint16_t GetTtg (void) const
void SetRtg (uint16_t rtg)
uint16_t GetRtg (void) const
void Attach (Ptr< WimaxChannel > channel)
void SetPhy (Ptr< WimaxPhy > phy)
Ptr< WimaxPhyGetPhy (void) const
void SetChannel (Ptr< WimaxChannel > wimaxChannel)
uint64_t GetChannel (uint8_t index) const
void SetNrFrames (uint32_t nrFrames)
uint32_t GetNrFrames (void) const
void SetMacAddress (Mac48Address address)
Mac48Address GetMacAddress (void) const
void SetState (uint8_t state)
uint8_t GetState (void) const
Ptr< WimaxConnectionGetInitialRangingConnection (void) const
Ptr< WimaxConnectionGetBroadcastConnection (void) const
void SetCurrentDcd (Dcd dcd)
Dcd GetCurrentDcd (void) const
void SetCurrentUcd (Ucd ucd)
Ucd GetCurrentUcd (void) const
Ptr< ConnectionManagerGetConnectionManager (void) const
virtual void SetConnectionManager (Ptr< ConnectionManager > connectionManager)
Ptr< BurstProfileManagerGetBurstProfileManager (void) const
void SetBurstProfileManager (Ptr< BurstProfileManager > burstProfileManager)
Ptr< BandwidthManagerGetBandwidthManager (void) const
void SetBandwidthManager (Ptr< BandwidthManager > bandwidthManager)
void CreateDefaultConnections (void)
virtual void Start (void)=0
virtual void Stop (void)=0
void SetReceiveCallback (void)
void ForwardUp (Ptr< Packet > packet, const Mac48Address &source, const Mac48Address &dest)
virtual bool Enqueue (Ptr< Packet > packet, const MacHeaderType &hdrType, Ptr< WimaxConnection > connection)=0
void ForwardDown (Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType)
virtual void SetName (const std::string name)
virtual std::string GetName (void) const
virtual void SetIfIndex (const uint32_t index)
virtual uint32_t GetIfIndex (void) const
virtual Ptr< ChannelGetPhyChannel (void) const
virtual Ptr< ChannelGetChannel (void) const
virtual void SetAddress (Address address)
virtual Address GetAddress (void) const
virtual bool SetMtu (const uint16_t mtu)
virtual uint16_t GetMtu (void) const
virtual bool IsLinkUp (void) const
virtual void SetLinkChangeCallback (Callback< void > callback)
virtual bool IsBroadcast (void) const
virtual Address GetBroadcast (void) const
virtual bool IsMulticast (void) const
virtual Address GetMulticast (void) const
virtual Address MakeMulticastAddress (Ipv4Address multicastGroup) const
virtual bool IsPointToPoint (void) const
 Return true if the net device is on a point-to-point link.
virtual bool Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void SetNode (Ptr< Node > node)
virtual Ptr< NodeGetNode (void) const
virtual bool NeedsArp (void) const
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb)
virtual void AddLinkChangeCallback (Callback< void > callback)
virtual bool SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb)
NetDevice::PromiscReceiveCallback GetPromiscReceiveCallback (void)
virtual bool SupportsSendFrom (void) const
virtual void DoDispose (void)
virtual Address GetMulticast (Ipv6Address addr) const
 Get the MAC multicast address corresponding to the IPv6 address provided.
virtual Address GetMulticast (Ipv4Address multicastGroup) const
 Make and return a MAC multicast address using the provided multicast group.
virtual bool IsBridge (void) const
 Return true if the net device is acting as a bridge.
bool IsPromisc (void)
void NotifyPromiscTrace (Ptr< Packet > p)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::WimaxNetDevice.

Public Attributes

TracedCallback< Ptr< const
Packet >, const Mac48Address & > 
m_traceRx
TracedCallback< Ptr< const
Packet >, const Mac48Address & > 
m_traceTx

Static Public Attributes

static uint8_t m_direction = ~0
static Time m_frameStartTime = Seconds (0)

Detailed Description

Hold together all Wimax-related objects in a NetDevice.

This class holds together ns3::WimaxPhy, ns3::WimaxConnection, ns3::ConectionManager, ns3::BurstProfileManager, and ns3::BandwidthManager.


Member Function Documentation

void ns3::WimaxNetDevice::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.

References NS_FATAL_ERROR.

void ns3::WimaxNetDevice::DoDispose ( void  )
virtual

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.

References ns3::Object::Dispose().

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

Implements ns3::NetDevice.

Referenced by Send().

Ptr< BandwidthManager > ns3::WimaxNetDevice::GetBandwidthManager ( void  ) const
Returns:
the bandwidth manager installed on the device

Referenced by GetTypeId(), ns3::UplinkSchedulerRtps::Schedule(), and ns3::BaseStationNetDevice::Start().

Address ns3::WimaxNetDevice::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.

Ptr< WimaxConnection > ns3::WimaxNetDevice::GetBroadcastConnection ( void  ) const
Returns:
the broadcast connection

Referenced by ns3::BSSchedulerRtps::Schedule().

Ptr< BurstProfileManager > ns3::WimaxNetDevice::GetBurstProfileManager ( void  ) const
Returns:
the burst profile manager currently installed in the device

Referenced by ns3::BSSchedulerRtps::BSSchedulerRTPSConnection(), GetTypeId(), and ns3::SubscriberStationNetDevice::SendBurst().

Ptr< Channel > ns3::WimaxNetDevice::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.

Ptr< ConnectionManager > ns3::WimaxNetDevice::GetConnectionManager ( void  ) const
uint32_t ns3::WimaxNetDevice::GetIfIndex ( void  ) const
virtual
Returns:
index ifIndex of the device

Implements ns3::NetDevice.

Ptr< WimaxConnection > ns3::WimaxNetDevice::GetInitialRangingConnection ( void  ) const
Returns:
the initial ranging connection

Referenced by ns3::BSSchedulerRtps::Schedule().

Mac48Address ns3::WimaxNetDevice::GetMacAddress ( void  ) const
Returns:
the mac address of the net device

Referenced by ns3::SubscriberStationNetDevice::SendBurst().

uint16_t ns3::WimaxNetDevice::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.

Referenced by GetTypeId().

Address ns3::WimaxNetDevice::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.

References ns3::Mac48Address::GetMulticast(), and NS_LOG_LOGIC.

Address ns3::WimaxNetDevice::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.

References ns3::Mac48Address::GetMulticast(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Ptr< Node > ns3::WimaxNetDevice::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.

uint16_t ns3::WimaxNetDevice::GetRtg ( void  ) const
Returns:
receive/transmit transition gap

Referenced by GetTypeId(), and ns3::BaseStationNetDevice::Start().

uint16_t ns3::WimaxNetDevice::GetTtg ( void  ) const
Returns:
transmit/receive transition gap

Referenced by GetTypeId(), and ns3::BaseStationNetDevice::Start().

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

This method returns the TypeId associated to ns3::WimaxNetDevice.

This object is accessible through the following paths with Config::Set and Config::Connect:

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

Attributes defined for this type:

TraceSources defined for this type:

  • Rx: Receive trace
  • Tx: Transmit trace

Reimplemented from ns3::NetDevice.

Reimplemented in ns3::SubscriberStationNetDevice, and ns3::BaseStationNetDevice.

References GetBandwidthManager(), GetBurstProfileManager(), GetConnectionManager(), GetMtu(), GetPhy(), GetRtg(), GetTtg(), ns3::MakeTraceSourceAccessor(), SetBandwidthManager(), SetBurstProfileManager(), SetChannel(), SetConnectionManager(), SetMtu(), ns3::TypeId::SetParent(), SetPhy(), SetRtg(), and SetTtg().

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

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

Returns:
value of m_isBridge flag

Implements ns3::NetDevice.

References NS_LOG_FUNCTION_NOARGS.

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

Implements ns3::NetDevice.

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

Implements ns3::NetDevice.

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

Implements ns3::NetDevice.

bool ns3::WimaxNetDevice::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.

bool ns3::WimaxNetDevice::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.

bool ns3::WimaxNetDevice::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.

References ns3::Packet::AddHeader(), ns3::Mac48Address::ConvertFrom(), and GetAddress().

bool ns3::WimaxNetDevice::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.

References ns3::Packet::AddHeader(), and ns3::Mac48Address::ConvertFrom().

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

Set the address of this interface

Parameters:
addressaddress to set

Implements ns3::NetDevice.

References ns3::Mac48Address::ConvertFrom().

Referenced by ns3::WimaxHelper::Install().

void ns3::WimaxNetDevice::SetBandwidthManager ( Ptr< BandwidthManager bandwidthManager)
Parameters:
bandwidthManagerthe bandwidth manager to be installed on the device

Referenced by GetTypeId().

void ns3::WimaxNetDevice::SetBurstProfileManager ( Ptr< BurstProfileManager burstProfileManager)
Parameters:
burstProfileManagerthe burst profile manager to be installed on the device

Referenced by GetTypeId().

void ns3::WimaxNetDevice::SetChannel ( Ptr< WimaxChannel wimaxChannel)
Parameters:
wimaxChannelthe channel to be used

References ns3::WimaxPhy::Attach().

Referenced by GetTypeId().

void ns3::WimaxNetDevice::SetConnectionManager ( Ptr< ConnectionManager connectionManager)
virtual
Parameters:
connectionManagerthe commection manager to be installed in the device

Referenced by GetTypeId().

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

Implements ns3::NetDevice.

void ns3::WimaxNetDevice::SetMacAddress ( Mac48Address  address)
Parameters:
addressthe mac address of the net device
bool ns3::WimaxNetDevice::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.

Referenced by GetTypeId().

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

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

Implements ns3::NetDevice.

void ns3::WimaxNetDevice::SetPhy ( Ptr< WimaxPhy phy)
Parameters:
phythe phy layer to use.

Referenced by GetTypeId().

void ns3::WimaxNetDevice::SetPromiscReceiveCallback ( 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.

void ns3::WimaxNetDevice::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.

void ns3::WimaxNetDevice::SetRtg ( uint16_t  rtg)
Parameters:
rtgreceive/transmit transition gap

Referenced by GetTypeId(), and ns3::BaseStationNetDevice::Start().

void ns3::WimaxNetDevice::SetTtg ( uint16_t  ttg)
Parameters:
ttgtransmit/receive transition gap

Referenced by GetTypeId(), and ns3::BaseStationNetDevice::Start().

virtual void ns3::WimaxNetDevice::Start ( void  )
pure virtual

This method calls the virtual DoStart method on all the objects aggregated to this object. DoStart will be called only once over the lifetime of an object, just like DoDispose is called only once.

See also:
DoStart

Note: the code here is a bit tricky because we need to protect ourselves from modifications in the aggregate array while DoStart is called. The user's implementation of the DoStart method could call GetObject (which could reorder the array) and it could call AggregateObject which would add an object at the end of the array. To be safe, we restart iteration over the array whenever we call some user code, just in case.

Reimplemented from ns3::Object.

Implemented in ns3::SubscriberStationNetDevice, and ns3::BaseStationNetDevice.

Referenced by ns3::WimaxHelper::Install().

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

Implements ns3::NetDevice.


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