diff --git a/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc b/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc index 5d68f221de5..2511880c470 100644 --- a/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc +++ b/src/inet/networklayer/configurator/base/L3NetworkConfiguratorBase.cc @@ -383,7 +383,14 @@ double L3NetworkConfiguratorBase::computeWirelessLinkWeight(Link *link, const ch cModule *receiverInterfaceModule = receiverInterfaceInfo->networkInterface; const IRadio *transmitterRadio = check_and_cast(transmitterInterfaceModule->getSubmodule("radio")); const IRadio *receiverRadio = check_and_cast(receiverInterfaceModule->getSubmodule("radio")); - const Packet *macFrame = new Packet(); + Packet *macFrame = new Packet(); + auto byteCountChunk = makeShared(B(transmitterInterfaceInfo->networkInterface->getMtu())); + macFrame->insertAtBack(byteCountChunk); + + // KLUDGE the frame must contain the PHY header to create a transmission + macFrame->addTag()->setProtocol(&Protocol::ackingMac); + check_and_cast(transmitterRadio)->encapsulate(macFrame); + const IRadioMedium *radioMedium = receiverRadio->getMedium(); const ITransmission *transmission = transmitterRadio->getTransmitter()->createTransmission(transmitterRadio, macFrame, simTime()); const IArrival *arrival = radioMedium->getPropagation()->computeArrival(transmission, receiverRadio->getAntenna()->getMobility()); @@ -409,7 +416,7 @@ double L3NetworkConfiguratorBase::computeWirelessLinkWeight(Link *link, const ch auto byteCountChunk = makeShared(B(transmitterInterfaceInfo->networkInterface->getMtu())); transmittedFrame->insertAtBack(byteCountChunk); - // KLUDGE + // KLUDGE the frame must contain the PHY header to create a transmission transmittedFrame->addTag()->setProtocol(&Protocol::ackingMac); check_and_cast(transmitterRadio)->encapsulate(transmittedFrame);