ns-3
|
CW-MAC A MAC protocol similar in idea to the 802.11 DCF with constant backoff window. More...
#include <uan-mac-cw.h>
Public Member Functions | |
virtual void | SetCw (uint32_t cw) |
virtual void | SetSlotTime (Time duration) |
virtual uint32_t | GetCw (void) |
virtual Time | GetSlotTime (void) |
virtual Address | GetAddress () |
virtual void | SetAddress (UanAddress addr) |
virtual bool | Enqueue (Ptr< Packet > pkt, const Address &dest, uint16_t protocolNumber) |
virtual void | SetForwardUpCb (Callback< void, Ptr< Packet >, const UanAddress & > cb) |
virtual void | AttachPhy (Ptr< UanPhy > phy) |
virtual Address | GetBroadcast (void) const |
virtual void | Clear (void) |
virtual void | NotifyRxStart (void) |
Function called by UanPhy object to notify of packet reception. | |
virtual void | NotifyRxEndOk (void) |
Function called by UanPhy object to notify of packet received successfully. | |
virtual void | NotifyRxEndError (void) |
Function called by UanPhy object to notify of packet received in error. | |
virtual void | NotifyCcaStart (void) |
Function called by UanPhy object to notify of channel sensed busy. | |
virtual void | NotifyCcaEnd (void) |
Function called by UanPhy object to notify of channel no longer sensed busy. | |
virtual void | NotifyTxStart (Time duration) |
Function called by UanPhy object to notify of outgoing transmission start. |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::UanMacCw. |
Protected Member Functions | |
virtual void | DoDispose () |
CW-MAC A MAC protocol similar in idea to the 802.11 DCF with constant backoff window.
For more information on this MAC protocol, see: Parrish, N.; Tracy, L.; Roy, S.; Arabshahi, P.; Fox, W., "System Design Considerations for Undersea Networks: Link and Multiple Access Protocols," Selected Areas in Communications, IEEE Journal on , vol.26, no.9, pp.1720-1730, December 2008
Attach PHY layer to this MAC. Some MACs may be designed to work with multiple PHY layers. Others may only work with one.
phy | Phy layer to attach to this MAC |
Implements ns3::UanMac.
References ns3::MakeCallback(), ns3::UanPhy::RegisterListener(), ns3::UanPhy::SetReceiveErrorCallback(), and ns3::UanPhy::SetReceiveOkCallback().
|
virtual |
Clears all pointer references
Implements ns3::UanMac.
References ns3::EventId::Cancel(), and ns3::UanPhy::Clear().
Referenced by DoDispose().
|
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.
References Clear().
|
virtual |
Enqueue packet to be transmitted
pkt | Packet to be transmitted |
dest | Destination address |
protocolNumber | Protocol #. Usage varies by MAC |
Implements ns3::UanMac.
References ns3::Packet::AddHeader(), ns3::UanAddress::ConvertFrom(), GetAddress(), ns3::UanTransducer::GetArrivalList(), ns3::Time::GetSeconds(), ns3::Packet::GetSize(), ns3::UanPhy::GetTransducer(), ns3::UniformVariable::GetValue(), ns3::EventId::IsRunning(), ns3::UanPhy::IsStateBusy(), ns3::UanPhy::IsStateTx(), ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::Seconds(), ns3::UanPhy::SendPacket(), ns3::UanHeaderCommon::SetDest(), ns3::UanHeaderCommon::SetSrc(), and ns3::UanHeaderCommon::SetType().
|
virtual |
Implements ns3::UanMac.
Referenced by Enqueue(), NotifyCcaEnd(), NotifyCcaStart(), NotifyRxEndError(), NotifyRxEndOk(), and NotifyRxStart().
|
virtual |
Implements ns3::UanMac.
|
virtual |
|
virtual |
|
static |
This method returns the TypeId associated to ns3::UanMacCw.
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::UanMac.
References ns3::MakeTraceSourceAccessor(), ns3::MilliSeconds(), and ns3::TypeId::SetParent().
|
virtual |
addr | UanAddress for this MAC |
Implements ns3::UanMac.
|
virtual |
cw | Contention window size |
|
virtual |
cb | Callback to be called when a packet is forwarded up to higher layer |
Implements ns3::UanMac.
|
virtual |
duration | Slot time duration |