22 #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 (Deprecated!)",
42 MakeUintegerChecker<uint32_t> ())
75 uint32_t actualSize = aggregatedPacket->
GetSize ();
87 currentPacket = packet->
Copy ();
90 aggregatedPacket->
AddAtEnd (currentPacket);
114 currentPacket = packet->
Copy ();
117 aggregatedPacket->
AddAtEnd (currentPacket);
139 if (padding && !last)
150 uint32_t actualSize = aggregatedPacket->
GetSize ();
151 if (blockAckSize > 0)
153 blockAckSize = blockAckSize + 4 + padding;
155 if ((4 + packetSize + actualSize + padding + blockAckSize) <=
m_maxAmpduLength)
168 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 void SetMaxAmpduSize(uint32_t maxSize)
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).
virtual void AggregateVhtSingleMpdu(Ptr< const Packet > packet, Ptr< Packet > aggregatedPacket)
This method performs a VHT single MPDU aggregation.
~MpduStandardAggregator()
virtual uint32_t GetMaxAmpduSize(void) const
virtual void AddHeaderAndPad(Ptr< Packet > packet, bool last, bool vhtSingleMpdu)
Adds A-MPDU subframe header and padding to each MPDU that is part of an A-MPDU before it is sent...
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Hold an unsigned integer type.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
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)
Set the parent TypeId.
void AddHeader(const Header &header)
Add header to this packet.