-
Notifications
You must be signed in to change notification settings - Fork 527
ieee80211: make rate control adapt per receiver, add per-receiver configured rates #1124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adamgeorge309
wants to merge
7
commits into
master
Choose a base branch
from
topic/gy/ieee80211-per-station-rate-control
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2524f05
ieee80211: fix TxopProcedure::getRemaining() returning the elapsed time
adamgeorge309 4fbc4a9
ieee80211: add StationLabelCache
adamgeorge309 ba82e7d
ieee80211: make rate control adapt per receiver
adamgeorge309 d032df9
ieee80211: add per-receiver configured unicast data-frame rates
adamgeorge309 9c5c4d2
ieee80211: tag datarateSelected with the receiving station
adamgeorge309 1be82e6
ieee80211: seed the rate control interval timer when a station is fir…
adamgeorge309 0248366
ieee80211: resolve station labels recursively, and label by network-r…
adamgeorge309 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/inet/linklayer/ieee80211/mac/common/StationLabelCache.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // | ||
| // Copyright (C) 2026 OpenSim Ltd. | ||
| // | ||
| // SPDX-License-Identifier: LGPL-3.0-or-later | ||
| // | ||
|
|
||
|
|
||
| #include "inet/linklayer/ieee80211/mac/common/StationLabelCache.h" | ||
|
|
||
| #include "inet/networklayer/common/L3AddressResolver.h" | ||
|
|
||
| namespace inet { | ||
| namespace ieee80211 { | ||
|
|
||
| const std::string& StationLabelCache::getLabel(const MacAddress& receiver) | ||
| { | ||
| auto cached = labels.find(receiver); | ||
| if (cached != labels.end()) | ||
| return cached->second; | ||
| // resolve the receiver MAC to the network node that owns it; fall back to the MAC | ||
| std::string label = receiver.str(); | ||
| if (cModule *node = L3AddressResolver().findHostWithMacAddress(receiver)) { | ||
| // the path relative to the network, so that nodes of the same name in different | ||
| // subnetworks get different labels; for a node directly under the network this | ||
| // is just its name | ||
| label = node->getFullPath(); | ||
| std::string networkPrefix = std::string(getSimulation()->getSystemModule()->getFullName()) + "."; | ||
| if (label.compare(0, networkPrefix.length(), networkPrefix) == 0) | ||
| label.erase(0, networkPrefix.length()); | ||
| } | ||
| return labels[receiver] = label; | ||
| } | ||
|
|
||
| } // namespace ieee80211 | ||
| } // namespace inet | ||
|
|
42 changes: 42 additions & 0 deletions
42
src/inet/linklayer/ieee80211/mac/common/StationLabelCache.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // | ||
| // Copyright (C) 2026 OpenSim Ltd. | ||
| // | ||
| // SPDX-License-Identifier: LGPL-3.0-or-later | ||
| // | ||
|
|
||
|
|
||
| #ifndef __INET_STATIONLABELCACHE_H | ||
| #define __INET_STATIONLABELCACHE_H | ||
|
|
||
| #include <map> | ||
| #include <string> | ||
|
|
||
| #include "inet/linklayer/common/MacAddress.h" | ||
|
|
||
| namespace inet { | ||
| namespace ieee80211 { | ||
|
|
||
| /** | ||
| * Resolves receiver MAC addresses to peer network node names, caching the result. | ||
| * | ||
| * The label identifies a station in a per-station signal emission: it names the details | ||
| * object emitted with the value, which a demux() result filter and the statistic bar | ||
| * chart visualizer key their per-station series on. Resolving sweeps the interface | ||
| * tables of all network nodes recursively, so it is done at most once per receiver. | ||
| */ | ||
| class INET_API StationLabelCache | ||
| { | ||
| protected: | ||
| std::map<MacAddress, std::string> labels; | ||
|
|
||
| public: | ||
| // The receiver's network node path relative to the network if it can be resolved | ||
| // (just the node name unless it is nested in a subnetwork), otherwise the MAC address string. | ||
| const std::string& getLabel(const MacAddress& receiver); | ||
| }; | ||
|
|
||
| } // namespace ieee80211 | ||
| } // namespace inet | ||
|
|
||
| #endif | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 A newly seen peer's rate immediately jumps one step above the configured starting rate
The per-peer rate state is created with an unset timer (
State state;atsrc/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.cc:45), so the periodic "increase" deadline is already in the past the moment the peer appears, and the very first transmission to it is sent one rate step above the configured starting rate.Impact: The configured starting rate is effectively ignored for every peer first used after the increase interval, and an extra spurious rate-change value is recorded for that peer.
Timer initialised to zero makes increaseRateIfTimerIsExpired fire on first use
State::timerdefaults toSIMTIME_ZERO(src/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.h:26).getRate()callsstateFor()and thenincreaseRateIfTimerIsExpired(state)(src/inet/linklayer/ieee80211/mac/ratecontrol/AarfRateControl.cc:124-125), whose condition issimTime() - state.timer >= interval(default 50 ms). For any station whose state is created after t = 50 ms this is immediately true, sostate.modeis bumped to the next faster mode and a seconddatarateChangedis emitted before the first frame is sent. Previously there was a single module-wide state created at t≈0, so this typically did not happen; with lazily created per-peer state it happens for essentially every peer.frameTransmitted()has the same path. Initialisingstate.timer = simTime()at creation preserves the intended "seeded from initialRate" semantics.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a follow-up commit — confirmed, thanks.
Reproduced in
examples/wireless/hiddennodewithinitialRate = 2Mbpsand traffic starting at t = 1s: the per-station vector opened with two values at t = 1, 2 Mbps then 5.5 Mbps, and the first frame went out at 5.5 Mbps. With the timer seeded at creation it opens with a single 2 Mbps value.OnoeRateControlhas the same defect and is fixed in the same commit. It is milder there —computeMode()returns early while the station has no successful transmission yet — but it still divides by zero on the way in, leavingavgRetriesPerFrameat NaN.