Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ simtime_t TxopProcedure::getRemaining() const
if (start == -1)
throw cRuntimeError("Txop has not started yet");
auto now = simTime();
return now > start + limit ? 0 : now - start;
return now > start + limit ? 0 : start + limit - now;
}

simtime_t TxopProcedure::getDuration() const
Expand Down
2 changes: 1 addition & 1 deletion tests/fingerprint/mipv6-refactoring.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# MIPv6 example — the primary test
/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, aa29-a8c5/~tNlb, PASS, wireless EthernetMac
/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, 068b-23aa/~tNlb, PASS, wireless EthernetMac
/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, c8dc-27c2/~tNlb, PASS, wireless EthernetMac
/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 7ed8-bee3/~tNlb, PASS, wireless EthernetMac

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 A stored reference result for a wireless roaming test was replaced even though that test cannot be affected by the change

The expected result for the mobile-IPv6 roaming test is overwritten with a new value (7ed8-bee3/~tNlb at tests/fingerprint/mipv6-refactoring.csv:13) even though that simulation never exercises the changed prioritized-transmission code, so a genuine unrelated change in behavior is silently accepted as the new baseline.
Impact: A real behavior change (or nondeterminism) in the roaming scenario is hidden, and future runs will be compared against a value that was never justified.

Why the roaming scenario cannot exercise TxopProcedure

TxopProcedure only exists inside Edcaf, which is instantiated inside Hcf, and Hcf is created only when qosStation is true (src/inet/linklayer/ieee80211/mac/Ieee80211Mac.ned:86 and :116). examples/ipv6/mipv6roaming/omnetpp.ini never sets qosStation (it configures **.wlan*.mac.dcf.channelAccess.cwMin), so the non-QoS DCF path is used and TxopProcedure::getRemaining() is never called.

Consistently, the actually TXOP-sensitive baselines (e.g. tests/fingerprint/examples.csv:657-661, tests/fingerprint/showcases.csv:316-317,344) were left untouched — which is plausible because the only caller, src/inet/linklayer/ieee80211/mac/framesequence/HcfFs.cc:65, evaluates getRemaining() > 0 and old/new expressions differ only at the exact expiry instant. That makes the single updated non-QoS row inconsistent with the rest of the change.

Prompt for agents
The fingerprint baseline for /examples/ipv6/mipv6roaming/ (Roaming config) was changed from c8dc-27c2/~tNlb to 7ed8-bee3/~tNlb in tests/fingerprint/mipv6-refactoring.csv, but this scenario runs the non-QoS DCF path (qosStation defaults to false in src/inet/linklayer/ieee80211/mac/Ieee80211Mac.ned and the ini never enables it), so TxopProcedure is not even instantiated and the getRemaining() fix cannot alter it. Re-run the roaming fingerprint on the base commit and on this branch to determine whether the difference is real; if the hash differs without this code change, the scenario is nondeterministic or the change came from elsewhere and the baseline update should be reverted/investigated rather than re-recorded. Also confirm whether the genuinely TXOP-dependent baselines (examples.csv wireless/qos and adhoc/qos rows, showcases.csv wireless/qos, txop, blockack, aggregation rows) still pass.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@mgonzalezlopezudc mgonzalezlopezudc Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root cause: bookkeeping failure to the July 802.11 on-wire serialization batch, which updated the duplicate examples.csv row’s data-sensitive fingerprint but omitted mipv6-refactoring.csv.

Historical isolation found the real cause:

  • Commit 632e460 reproduces c8dc-27c2.
  • The sequence-control endian change still reproduces c8dc-27c2.
  • Adding the association-ID allocation changes it exactly to 7ed8-bee3.
  • The AP now writes allocated AIDs into association/reassociation responses at Ieee80211MgmtAp.cc (line 266). Event count remains 59,408, proving this is serialized packet-content change, not changed scheduling.

The corresponding examples.csv row (line 385) already contains the correct network fingerprints; tplx, ~tNl, and ~tND all passed. Its graphical tyf ingredient differed under fake-GUI execution, but that ingredient is unrelated and intentionally unreliable.

I also reran all 20 relevant QoS/HCF baselines across examples.csv and showcases.csv, including the dedicated TXOP showcase. Every baseline passed unchanged, so the TXOP fix requires no additional fingerprint updates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levy ready for your review and approval


# IPv6 examples
# MLD example — new PASS row; ~tNl locks the MLD Report/Query/Done/MAS-Query packet exchange (traffic+lengths);
Expand Down
86 changes: 86 additions & 0 deletions tests/unit/Ieee80211TxopProcedure_1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
%description:
Tests that TxopProcedure reports the remaining time until the TXOP limit.

%includes:
#include "inet/linklayer/ieee80211/mac/originator/TxopProcedure.h"

using namespace omnetpp;
using namespace inet;
using namespace inet::ieee80211;

namespace Ieee80211TxopProcedure_1 {

class TestTxopProcedure : public TxopProcedure
{
protected:
virtual void initialize(int stage) override
{
if (stage == INITSTAGE_LOCAL)
limit = par("txopLimit");
}
};

Define_Module(TestTxopProcedure);

} // namespace Ieee80211TxopProcedure_1

%file: TestNetwork.ned

import inet.linklayer.ieee80211.mac.originator.TxopProcedure;

simple TestTxopProcedure extends TxopProcedure
{
parameters:
@class(TestTxopProcedure);
}

network TestNetwork
{
submodules:
test: Test;
txop: TestTxopProcedure {
parameters:
txopLimit = 10ms;
}
}

%inifile: omnetpp.ini
[General]
ned-path = .;../../../../src;../../lib
network = TestNetwork

%activity:

auto txop = check_and_cast<TxopProcedure *>(cSimulation::getActiveSimulation()->getModuleByPath("txop"));

auto getRemainingThrows = [txop]() {
try {
txop->getRemaining();
return false;
}
catch (const cRuntimeError&) {
return true;
}
};

ASSERT(getRemainingThrows());

txop->startTxop(AC_VI);
ASSERT(txop->getRemaining() == SimTime(10, SIMTIME_MS));

wait(0.003);
ASSERT(txop->getRemaining() == SimTime(7, SIMTIME_MS));

wait(0.007);
ASSERT(txop->getRemaining() == SIMTIME_ZERO);

wait(0.001);
ASSERT(txop->getRemaining() == SIMTIME_ZERO);

txop->endTxop();
ASSERT(getRemainingThrows());

EV << "TXOP remaining time is correct at all boundaries.\n";

%contains: stdout
TXOP remaining time is correct at all boundaries.