This implementation makes sense to me and when I run a simulation with 2 stations sending each other data, Station One correctly sees on its queue that it has a packet to Station 2 and sends it as an ACKDATA. Then Station 2 correctly receives it as an ACK and as Data, and replies with ACK.
But when Station 1 receives this final ACK it crashes when it enters the m_listener->GotAck() routine, with the following backtrace
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7b77c54 in ns3::Buffer::GetSize (this=0x8) at ./ns3/buffer.h:1072
1072 return m_end - m_start;
(gdb) backtrace
#0 0x00007ffff7b77c54 in ns3::Buffer::GetSize (this=0x8)
at ./ns3/buffer.h:1072
#1 0x00007ffff7b77e40 in ns3::Packet::GetSize (this=0x0) at ./ns3/packet.h:768
#2 0x00007ffff20c7e2b in ns3::WifiRemoteStationManager::NeedFragmentation (
this=0x716090, address=..., header=0x7176b0, packet=...)
at ../src/wifi/model/wifi-remote-station-manager.cc:803
#3 0x00007ffff209033f in ns3::DcaTxop::NeedFragmentation (this=0x717630)
at ../src/wifi/model/dca-txop.cc:354
#4 0x00007ffff20952a6 in ns3::DcaTxop::GotAck (this=0x717630,
snr=3590,7020839224456, txMode=...) at ../src/wifi/model/dca-txop.cc:585
#5 0x00007ffff2097654 in ns3::DcaTxop::TransmissionListener::GotAck (
this=0x716dd0, snr=3590,7020839224456, txMode=...)
at ../src/wifi/model/dca-txop.cc:111
#6 0x00007ffff20611ba in ns3::MacLow::ReceiveOk (this=0x7163f0, packet=...,
rxSnr=3590,7020839224456, txMode=..., preamble=ns3::WIFI_PREAMBLE_LONG,
ampduSubframe=false) at ../src/wifi/model/mac-low.cc:986
It looks like it will check if the sent packet needed fragmentation and check for m_currentPacket and m_currentHdr, but those two dont correspond to the last packet sent (the ACKDATA Packet).
Am I transmitting the ACKDATA Packet correctly?
Thank you for your kind patience,
Arthur.