21 #include "ns3/uinteger.h"
35 static TypeId tid =
TypeId (
"ns3::MpduStandardAggregator")
37 .SetGroupName (
"Wifi")
39 .AddAttribute (
"MaxAmpduSize",
"Max length in bytes of an A-MPDU",
42 MakeUintegerChecker<uint32_t> ())
63 uint32_t actualSize = aggregatedPacket->
GetSize ();
75 currentPacket = packet->
Copy ();
78 aggregatedPacket->
AddAtEnd (currentPacket);
108 uint32_t actualSize = aggregatedPacket->
GetSize ();
109 if (blockAckSize > 0)
111 blockAckSize = blockAckSize + 4 + padding;
113 if ((4 + packetSize + actualSize + padding + blockAckSize) <=
m_maxAmpduLength)
126 return (4 - (packet->
GetSize () % 4 )) % 4;
Abstract class that concrete mpdu aggregators have to implement.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual bool Aggregate(Ptr< const Packet > packet, Ptr< Packet > aggregatedPacket)
uint32_t m_maxAmpduLength
Maximum length in bytes of A-MPDUs.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static TypeId GetTypeId(void)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
~MpduStandardAggregator()
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Hold an unsigned integer type.
virtual void AddHeaderAndPad(Ptr< Packet > packet, bool last)
Adds A-MPDU subframe header and padding to each MPDU that is part of an A-MPDU before it is sent...
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Standard MPDU aggregator.
virtual uint32_t CalculatePadding(Ptr< const Packet > packet)
virtual bool CanBeAggregated(uint32_t packetSize, Ptr< Packet > aggregatedPacket, uint8_t blockAckSize)
static const uint32_t packetSize
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void AddHeader(const Header &header)
Add header to this packet.