Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions WHATSNEW
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,22 @@ Notable backward incompatible changes are the following:
Ieee80211ModeBase supplies default unknown values for custom subclasses.
The migration guide explains the return values and required overrides.

18. IEEE 802.11 radio commands wait for an accepted frame

Tx is the component that transmits frames for medium access control (MAC).
Radio reconfiguration now waits until Tx completes an accepted transmission.
This includes the short interframe space (SIFS) before a response.
The MAC previously used only the medium state, which cannot identify that wait.

For example, a radio command arrives while Tx waits to transmit an
acknowledgment (ACK) frame. The MAC keeps the command until the ACK completes.
This prevents radio reconfiguration before the accepted response completes.
The change affects event order and the event fingerprints of IEEE 802.11 simulations.

Custom implementations of ITx must implement hasTransmission() before they compile again.
The method identifies both the wait before transmission and the transmission itself.
The migration guide explains the return values and the order of the completion callback.

Notable backward compatible changes are the following:

1. IEEE 802.11 per-station rate statistics
Expand Down
28 changes: 28 additions & 0 deletions doc/src/migration-guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ Migrating Code from INET 3.x
============================
Release: |release|

IEEE 802.11 Radio Command Deferral
---------------------------------

Tx is the component that transmits frames for medium access control (MAC).
The MAC keeps a radio command while Tx retains an accepted transmission.
This includes the short interframe space (SIFS) before a response.
The hybrid coordination function (HCF) and distributed coordination function (DCF)
release the pending command after the response completes.
This prevents radio reconfiguration before the accepted response completes.

Custom implementations of ``ITx`` need the new method to compile.
Implement the query with this signature:

.. code-block:: c++

[[nodiscard]] bool hasTransmission() const override;

1. Return true after Tx accepts a frame, including any wait before transmission starts.
2. Keep the return value true while Tx transmits the frame.
3. Clear the accepted transmission state before Tx calls ``ICallback::transmissionComplete()``.
4. Return false when Tx holds no accepted transmission.

The completion callback can release a pending command, so it must observe the cleared state.
For example, Tx accepts an acknowledgment (ACK) frame with a SIFS delay.
A radio command arrives during that delay, when ``hasTransmission()`` returns true.
The MAC keeps the command until the ACK completes.
Tx clears its state before the callback, so the coordination function can release the command.

IEEE 802.11 PHY Mode Properties
-------------------------------

Expand Down
7 changes: 4 additions & 3 deletions src/inet/linklayer/ieee80211/mac/Ieee80211Mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void Ieee80211Mac::handleUpperCommand(cMessage *msg)
pendingRadioConfigMsg = nullptr;
}

if (rx->isMediumFree()) { // TODO this should be just the physical channel sense!!!!
if (rx->isMediumFree() && !tx->hasTransmission()) { // TODO this should be just the physical channel sense!!!!
EV_DEBUG << "Sending it down immediately\n";
// PhyControlInfo *phyControlInfo = dynamic_cast<PhyControlInfo *>(msg->getControlInfo());
// if (phyControlInfo)
Expand Down Expand Up @@ -387,9 +387,10 @@ void Ieee80211Mac::sendDownFrame(Packet *frame)

void Ieee80211Mac::sendDownPendingRadioConfigMsg()
{
if (pendingRadioConfigMsg != nullptr) {
sendDown(pendingRadioConfigMsg);
if (pendingRadioConfigMsg != nullptr && !tx->hasTransmission()) {
auto message = pendingRadioConfigMsg;
pendingRadioConfigMsg = nullptr;
sendDown(message);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/inet/linklayer/ieee80211/mac/Tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class INET_API Tx : public SimpleModule, public ITx

virtual void transmitFrame(Packet *packet, const Ptr<const Ieee80211MacHeader>& header, ITx::ICallback *txCallback) override;
virtual void transmitFrame(Packet *packet, const Ptr<const Ieee80211MacHeader>& header, simtime_t ifs, ITx::ICallback *txCallback) override;
[[nodiscard]] bool hasTransmission() const override { return txCallback != nullptr; }
virtual void radioTransmissionFinished() override;
};

Expand Down
9 changes: 9 additions & 0 deletions src/inet/linklayer/ieee80211/mac/contract/ITx.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class INET_API ITx

virtual void transmitFrame(Packet *packet, const Ptr<const Ieee80211MacHeader>& header, ICallback *callback) = 0;
virtual void transmitFrame(Packet *packet, const Ptr<const Ieee80211MacHeader>& header, simtime_t ifs, ICallback *callback) = 0;
/**
* The query returns true while Tx retains an accepted frame,
* including any wait before transmission and the transmission itself.
* Tx clears this state before it calls ICallback::transmissionComplete(),
* so the callback can release pending radio commands.
* The query returns false when Tx holds no accepted transmission.
* For example, an accepted ACK with a SIFS delay keeps this query true until transmission ends.
*/
[[nodiscard]] virtual bool hasTransmission() const = 0;
virtual void radioTransmissionFinished() = 0;
};

Expand Down
4 changes: 3 additions & 1 deletion src/inet/linklayer/ieee80211/mac/coordinationfunction/Dcf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ void Dcf::transmissionComplete(Packet *packet, const Ptr<const Ieee80211MacHeade
if (frameSequenceHandler->isSequenceRunning()) {
frameSequenceHandler->transmissionComplete();
}
else
else {
recipientProcessTransmittedControlResponseFrame(packet, header);
mac->sendDownPendingRadioConfigMsg();
}
}

bool Dcf::hasFrameToTransmit()
Expand Down
4 changes: 3 additions & 1 deletion src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,10 @@ void Hcf::transmissionComplete(Packet *packet, const Ptr<const Ieee80211MacHeade
}
else if (hcca->isOwning())
throw cRuntimeError("Hcca is unimplemented!");
else
else {
recipientProcessTransmittedControlResponseFrame(packet, header);
mac->sendDownPendingRadioConfigMsg();
}
}

void Hcf::originatorProcessRtsProtectionFailed(Packet *packet)
Expand Down
3 changes: 2 additions & 1 deletion src/inet/linklayer/ieee80211/mac/coordinationfunction/Hcf.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class INET_API Hcf : public ICoordinationFunction, public IFrameSequenceHandler:
void startFrameSequence(AccessCategory ac);
void handleInternalCollision(std::vector<Edcaf *> internallyCollidedEdcafs);

void sendUp(const std::vector<Packet *>& completeFrames);
// Tests can consume received frames here without an upper protocol stack.
virtual void sendUp(const std::vector<Packet *>& completeFrames);
FrameSequenceContext *buildContext(AccessCategory ac);
virtual bool hasFrameToTransmit();
virtual bool hasFrameToTransmit(AccessCategory ac);
Expand Down
26 changes: 13 additions & 13 deletions tests/fingerprint/examples.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
/examples/communicationcache/, -f omnetpp.ini -c VectorCommunicationCache -r 0, 10s, 4c65-91ae/tplx;72b5-8f0b/~tNl;190a-bc02/~tND;40ef-e3e2/tyf, PASS, wireless Ipv4

/examples/dhcp/, -f omnetpp.ini -c WiredDHCP -r 0, 5000s, 218c-c7d8/tplx;2fea-5f49/~tNl;97d9-613e/~tND;8a53-9a15/tyf, PASS, EthernetMac Ipv4
/examples/dhcp/, -f omnetpp.ini -c WirelessDHCP -r 0, 500s, 0429-2765/tplx;7b02-afe3/~tNl;6ea6-9583/~tND;d3a7-5f49/tyf, PASS, wireless EthernetMac Ipv4
/examples/dhcp/, -f omnetpp.ini -c Wireless2DHCP -r 0, 500s, e5ee-dbd9/tplx;c750-5ba3/~tNl;e948-81ed/~tND;3497-9980/tyf, PASS, wireless EthernetMac Ipv4
/examples/dhcp/, -f omnetpp.ini -c WirelessDHCP -r 0, 500s, 761b-5d89/tplx;7b02-afe3/~tNl;6ea6-9583/~tND;d3a7-5f49/tyf, PASS, wireless EthernetMac Ipv4
/examples/dhcp/, -f omnetpp.ini -c Wireless2DHCP -r 0, 500s, 44fe-ee41/tplx;c750-5ba3/~tNl;e948-81ed/~tND;3497-9980/tyf, PASS, wireless EthernetMac Ipv4
/examples/dhcp/, -f omnetpp.ini -c RebootingDHCP -r 0, 500s, 556b-32fd/tplx;a999-2790/~tNl;770b-f78a/~tND;fbd6-20e8/tyf, PASS, EthernetMac Ipv4

# /examples/diffserv/onedomain/, -f omnetpp.ini -c Apps -r 0, 10s, 0, PASS, # abstract-config
Expand Down Expand Up @@ -380,10 +380,10 @@
/examples/manetrouting/multiradio/, -f omnetpp.ini -c MultiRadio -r 0, 20s, ec17-5cc2/tplx;55f5-0894/~tNl, PASS, wireless adhoc Ipv4
/examples/manetrouting/multiradio/, -f omnetpp.ini -c SingleRadio -r 0, 20s, 85a0-51b8/tplx;c07a-44e1/~tNl;3aa0-49ed/tyf, PASS, wireless adhoc Ipv4

/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, dca6-3751/tplx;a44c-17bf/~tNl;96ff-ed7c/~tND;44ef-1a45/tyf, PASS, wireless EthernetMac
/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, 1560-028f/tplx;e6db-28c0/~tNl;805b-8a25/~tND;ed3e-17fa/tyf, PASS, wireless EthernetMac
/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 342e-5e65/tplx;28ce-974e/~tNl;dcec-ae59/~tND;afae-2b3c/tyf, PASS, wireless EthernetMac
/examples/ipv6/pmipv6/, -f omnetpp.ini -c General -r 0, 60s, 081b-769c/tplx;1064-9bd4/~tNl;bd46-d85c/~tND;0277-d784/tyf, PASS, wireless EthernetMac
/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, 68ea-9693/tplx;a44c-17bf/~tNl;96ff-ed7c/~tND;44ef-1a45/tyf, PASS, wireless EthernetMac
/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, bacf-986a/tplx;e6db-28c0/~tNl;805b-8a25/~tND;ed3e-17fa/tyf, PASS, wireless EthernetMac
/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, b275-b584/tplx;28ce-974e/~tNl;dcec-ae59/~tND;afae-2b3c/tyf, PASS, wireless EthernetMac
/examples/ipv6/pmipv6/, -f omnetpp.ini -c General -r 0, 60s, e801-4d1a/tplx;1064-9bd4/~tNl;bd46-d85c/~tND;0277-d784/tyf, PASS, wireless EthernetMac

/examples/mobility/, -f omnetpp.ini -c AnsimMobility -r 0, 10000s, 72f8-5c0b/tplx;0000-0000/~tNl;0000-0000/~tND;7dd1-18eb/tyf, PASS,
/examples/mobility, -f omnetpp.ini -c AttachedMobility, 10s, 566c-6355/tplx;0000-0000/~tNl;0000-0000/~tND;fa92-f68c/tyf, PASS,
Expand Down Expand Up @@ -573,7 +573,7 @@
/examples/wireless/filtering/, -f omnetpp.ini -c ListeningFilter -r 0, 100s, 946b-6f7f/tplx;e5d7-0ef7/~tNl;fc55-a160/~tND;17b4-4f41/tyf, PASS, Ipv4
/examples/wireless/filtering/, -f omnetpp.ini -c MacAddressFilter -r 0, 100s, d2d8-8182/tplx;d14e-6ff1/~tNl;1e5f-e0e5/~tND;1853-1300/tyf, PASS, Ipv4

/examples/wireless/handover/, -f omnetpp.ini -c General -r 0, 1500s, 1cb1-6c39/tplx;7bfd-9fb3/~tNl;6003-08fb/~tND;c710-ff2e/tyf, PASS, wireless
/examples/wireless/handover/, -f omnetpp.ini -c General -r 0, 1500s, c4ae-e504/tplx;7bfd-9fb3/~tNl;6003-08fb/~tND;c710-ff2e/tyf, PASS, wireless

/examples/wireless/hiddennode/, -f omnetpp.ini -c General -r 0, 5s, 8383-735e/tplx;8e4d-20ee/~tNl;d2b6-9157/~tND;af51-7b12/tyf, PASS, wireless

Expand Down Expand Up @@ -654,11 +654,11 @@

/examples/wireless/power/, -f omnetpp.ini -c General -r 0, 100s, 6fae-d558/tplx;b8ea-b2fc/~tNl;7a95-cf35/~tND, PASS, wireless Ipv4

/examples/wireless/qos/, -f omnetpp.ini -c MacNonQos -r 0, 10s, c3c0-dc93/tplx;5eb9-6cea/~tNl;87a5-11a1/~tND;6097-a429/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQos -r 0, 10s, 3a58-19c0/tplx;6188-6ffd/~tNl;377c-d4fc/~tND;9f3c-4512/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithoutAggregation -r 0, 10s, 33e5-c380/tplx;78d2-bb9a/~tNl;1524-d88f/~tND;a4c3-19bf/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithRtsCts -r 0, 10s, 7f3b-72ca/tplx;7c57-849b/~tNl;06e3-7901/~tND;b2d6-1329/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithBlockAck -r 0, 10s, 9d64-cc8f/tplx;6da9-a463/~tNl;d5b1-8768/~tND;08b5-d005/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacNonQos -r 0, 10s, 0be7-a22e/tplx;5eb9-6cea/~tNl;87a5-11a1/~tND;6097-a429/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQos -r 0, 10s, a686-bbed/tplx;6188-6ffd/~tNl;377c-d4fc/~tND;9f3c-4512/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithoutAggregation -r 0, 10s, 8ea1-98b9/tplx;78d2-bb9a/~tNl;1524-d88f/~tND;a4c3-19bf/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithRtsCts -r 0, 10s, 4686-3691/tplx;7c57-849b/~tNl;06e3-7901/~tND;b2d6-1329/tyf, PASS, wireless Ipv4
/examples/wireless/qos/, -f omnetpp.ini -c MacQosWithBlockAck -r 0, 10s, ee1e-4439/tplx;6da9-a463/~tNl;d5b1-8768/~tND;08b5-d005/tyf, PASS, wireless Ipv4

/examples/wireless/ratecontrol/, -f omnetpp.ini -c Mac -r 0, 100s, bf30-2f13/tplx;7b2f-653d/~tNl;6f09-d8eb/~tND;19fe-8b0e/tyf, PASS, wireless

Expand All @@ -678,4 +678,4 @@
/examples/wireless/throughput/, -f omnetpp.ini -c Throughput1 -r 0, 20s, a4d8-abf4/tplx;f424-9aaf/~tNl;8105-890f/~tND;bb2f-ec63/tyf, PASS, wireless
/examples/wireless/throughput/, -f omnetpp.ini -c Throughput2 -r 0, 10s, 3b2b-5123/tplx;0009-ca8c/~tNl;e1e4-92c8/~tND;032e-0333/tyf, PASS, wireless

/examples/wireless/wiredandwirelesshostswithap/, -f omnetpp.ini -c General -r 0, 100s, a93e-c671/tplx;13cb-5046/~tNl;6a1b-eaf7/~tND;b4df-273e/tyf, PASS, wireless EthernetMac Ipv4
/examples/wireless/wiredandwirelesshostswithap/, -f omnetpp.ini -c General -r 0, 100s, 757c-bb2d/tplx;13cb-5046/~tNl;6a1b-eaf7/~tND;b4df-273e/tyf, PASS, wireless EthernetMac Ipv4
Loading
Loading