22 #include "ns3/uinteger.h"
34 static TypeId tid =
TypeId (
"ns3::MpduStandardAggregator")
36 .SetGroupName (
"Wifi")
38 .AddAttribute (
"MaxAmpduSize",
"Max length in bytes of an A-MPDU (Deprecated!)",
41 MakeUintegerChecker<uint32_t> ())
74 uint32_t actualSize = aggregatedPacket->
GetSize ();
86 currentPacket = packet->
Copy ();
89 aggregatedPacket->
AddAtEnd (currentPacket);
113 currentPacket = packet->
Copy ();
116 aggregatedPacket->
AddAtEnd (currentPacket);
138 if (padding && !last)
149 uint32_t actualSize = aggregatedPacket->
GetSize ();
150 if (blockAckSize > 0)
152 blockAckSize = blockAckSize + 4 + padding;
154 if ((4 + packetSize + actualSize + padding + blockAckSize) <=
m_maxAmpduLength)
167 return (4 - (packet->
GetSize () % 4 )) % 4;
Abstract class that concrete mpdu aggregators have to implement.
void AggregateSingleMpdu(Ptr< const Packet > packet, Ptr< Packet > aggregatedPacket) const
void AddHeaderAndPad(Ptr< Packet > packet, bool last, bool isSingleMpdu) const
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetMaxAmpduSize(uint32_t maxSize)
Sets the maximum A-MPDU size in bytes.
bool Aggregate(Ptr< const Packet > packet, Ptr< Packet > aggregatedPacket) const
uint32_t m_maxAmpduLength
Maximum length in bytes of A-MPDUs.
uint32_t CalculatePadding(Ptr< const Packet > packet) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
static TypeId GetTypeId(void)
Get the type ID.
#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()
uint32_t GetMaxAmpduSize(void) const
Returns the maximum A-MPDU size in bytes.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
Hold an unsigned integer type.
bool CanBeAggregated(uint32_t packetSize, Ptr< Packet > aggregatedPacket, uint8_t blockAckSize) const
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.
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.