Skip to content

Commit

Permalink
L3NetworkConfiguratorBase: Fixed #913, copied frame creation code fro…
Browse files Browse the repository at this point in the history
…m "errorRate" to "delay" autoroute metric.

This fix is a temporary kludge but currently there's no other way to make this work.
  • Loading branch information
levy committed Oct 9, 2023
1 parent a7f2f35 commit 7644baf
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ double L3NetworkConfiguratorBase::computeWirelessLinkWeight(Link *link, const ch
cModule *receiverInterfaceModule = receiverInterfaceInfo->networkInterface;
const IRadio *transmitterRadio = check_and_cast<IRadio *>(transmitterInterfaceModule->getSubmodule("radio"));
const IRadio *receiverRadio = check_and_cast<IRadio *>(receiverInterfaceModule->getSubmodule("radio"));
const Packet *macFrame = new Packet();
Packet *macFrame = new Packet();
auto byteCountChunk = makeShared<ByteCountChunk>(B(transmitterInterfaceInfo->networkInterface->getMtu()));
macFrame->insertAtBack(byteCountChunk);

// KLUDGE the frame must contain the PHY header to create a transmission
macFrame->addTag<PacketProtocolTag>()->setProtocol(&Protocol::ackingMac);
check_and_cast<const Radio *>(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());
Expand All @@ -409,7 +416,7 @@ double L3NetworkConfiguratorBase::computeWirelessLinkWeight(Link *link, const ch
auto byteCountChunk = makeShared<ByteCountChunk>(B(transmitterInterfaceInfo->networkInterface->getMtu()));
transmittedFrame->insertAtBack(byteCountChunk);

// KLUDGE
// KLUDGE the frame must contain the PHY header to create a transmission
transmittedFrame->addTag<PacketProtocolTag>()->setProtocol(&Protocol::ackingMac);
check_and_cast<const Radio *>(transmitterRadio)->encapsulate(transmittedFrame);

Expand Down

0 comments on commit 7644baf

Please sign in to comment.