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
37 changes: 37 additions & 0 deletions examples/wireless/lan80211/omnetpp-ht-greenfield.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[General]
network = Lan80211
abstract = true
cmdenv-express-mode = true

**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 600m
**.constraintAreaMaxY = 400m
**.constraintAreaMaxZ = 0m

**.arp.typename = "GlobalArp"
**.opMode = "n(greenfield-2.4Ghz)"
**.wlan[*].bitrate = 13Mbps

*.ap.wlan[*].address = "10:00:00:00:00:00"
*.host[*].**.mgmt.accessPointAddress = "10:00:00:00:00:00"

*.ap.mobility.typename = "StationaryMobility"
*.ap.mobility.initialX = 250m
*.ap.mobility.initialY = 200m
*.host[*].mobility.typename = "StationaryMobility"
*.host[*].mobility.initialY = 200m
*.host[0].mobility.initialX = 260m
*.host[1].mobility.initialX = 270m

[Config HtGreenfield]
description = "HT Greenfield mode exchanging ping traffic through an access point"
sim-time-limit = 2s
*.numHosts = 2
*.host[0].numApps = 0
*.host[1].numApps = 1
*.host[1].app[0].typename = "PingApp"
*.host[1].app[0].destAddr = "host[0]"
*.host[1].app[0].sendInterval = 100ms
*.host[1].app[0].printPing = true
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module ExtUpperIeee80211Interface extends ExtInterface like IWirelessInterface
{
parameters:
string energySourceModule = default("");
string opMode @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","p","ac") = default("g(mixed)");
string opMode @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","n(greenfield-2.4Ghz)","p","ac") = default("g(mixed)");
double bitrate @unit(bps) = default(-1bps);
**.opMode = this.opMode;
**.bitrate = this.bitrate;
Expand Down Expand Up @@ -92,4 +92,3 @@ module ExtUpperIeee80211Interface extends ExtInterface like IWirelessInterface

classifier.in <-- { @display("m=n"); } <-- tap.lowerLayerOut;
}

3 changes: 1 addition & 2 deletions src/inet/linklayer/ieee80211/Ieee80211Interface.ned
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module Ieee80211Interface extends NetworkInterface like IWirelessInterface
parameters:
string interfaceTableModule;
string energySourceModule = default("");
string opMode @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","p","ac") = default("g(mixed)");
string opMode @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","n(greenfield-2.4Ghz)","p","ac") = default("g(mixed)");
string address @mutable = default("auto"); // MAC address as hex string (12 hex digits), or
// "auto". "auto" values will be replaced by
// a generated MAC address in init stage 0.
Expand Down Expand Up @@ -129,4 +129,3 @@ module Ieee80211Interface extends NetworkInterface like IWirelessInterface

classifier.in <-- { @display("m=n"); } <-- upperLayerIn;
}

3 changes: 1 addition & 2 deletions src/inet/linklayer/ieee80211/mac/Ieee80211Mac.ned
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module Ieee80211Mac extends MacProtocolBase like IIeee80211Mac
{
parameters:
string mibModule;
string modeSet @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","p","ac") = default("g(mixed)");
string modeSet @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","n(greenfield-2.4Ghz)","p","ac") = default("g(mixed)");
string fcsMode @enum("declared","computed") = default("declared");
string initialRadioMode @enum("off","sleep","receiver","transmitter","transceiver") = default("receiver");

Expand Down Expand Up @@ -130,4 +130,3 @@ module Ieee80211Mac extends MacProtocolBase like IIeee80211Mac
@display("p=250,200");
}
}

29 changes: 18 additions & 11 deletions src/inet/linklayer/ieee80211/mac/rateselection/QosRateSelection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ const IIeee80211Mode *QosRateSelection::computeResponseAckFrameMode(Packet *pack
auto mode = getMode(packet, dataOrMgmtHeader);
ASSERT(modeSet->containsMode(mode));
if (!responseAckFrameMode) {
if (modeSet->getIsMandatory(mode))
return mode;
else if (auto slowerMode = modeSet->getSlowerMandatoryMode(mode))
auto responseModeSet = modeSet->getControlResponseModeSet(mode);
auto responseMode = responseModeSet->getMode(mode);
if (responseModeSet->getIsMandatory(responseMode))
return responseMode;
else if (auto slowerMode = responseModeSet->getSlowerMandatoryMode(responseMode))
return slowerMode;
else
throw cRuntimeError("Mandatory mode not found");
}
else
return responseAckFrameMode;
return modeSet->getControlResponseMode(responseAckFrameMode);
}

const IIeee80211Mode *QosRateSelection::computeResponseCtsFrameMode(Packet *packet, const Ptr<const Ieee80211RtsFrame>& rtsFrame)
Expand All @@ -92,15 +94,17 @@ const IIeee80211Mode *QosRateSelection::computeResponseCtsFrameMode(Packet *pack
auto mode = getMode(packet, rtsFrame);
ASSERT(modeSet->containsMode(mode));
if (!responseCtsFrameMode) {
if (modeSet->getIsMandatory(mode))
return mode;
else if (auto slowerMode = modeSet->getSlowerMandatoryMode(mode))
auto responseModeSet = modeSet->getControlResponseModeSet(mode);
auto responseMode = responseModeSet->getMode(mode);
if (responseModeSet->getIsMandatory(responseMode))
return responseMode;
else if (auto slowerMode = responseModeSet->getSlowerMandatoryMode(responseMode))
return slowerMode;
else
throw cRuntimeError("Mandatory mode not found");
}
else
return responseCtsFrameMode;
return modeSet->getControlResponseMode(responseCtsFrameMode);
}

//
Expand All @@ -111,8 +115,12 @@ const IIeee80211Mode *QosRateSelection::computeResponseCtsFrameMode(Packet *pack
//
const IIeee80211Mode *QosRateSelection::computeResponseBlockAckFrameMode(Packet *packet, const Ptr<const Ieee80211BlockAckReq>& blockAckReq)
{
if (dynamicPtrCast<const Ieee80211BasicBlockAckReq>(blockAckReq))
return responseBlockAckFrameMode ? responseBlockAckFrameMode : getMode(packet, blockAckReq);
if (dynamicPtrCast<const Ieee80211BasicBlockAckReq>(blockAckReq)) {
if (responseBlockAckFrameMode)
return modeSet->getControlResponseMode(responseBlockAckFrameMode);
else
return modeSet->getControlResponseMode(getMode(packet, blockAckReq));
}
else
throw cRuntimeError("Unknown BlockAckReq frame type");
}
Expand Down Expand Up @@ -248,4 +256,3 @@ void QosRateSelection::frameTransmitted(Packet *packet, const Ptr<const Ieee8021

} /* namespace ieee80211 */
} /* namespace inet */

13 changes: 8 additions & 5 deletions src/inet/linklayer/ieee80211/mac/rateselection/RateSelection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,26 @@ const IIeee80211Mode *RateSelection::getMode(Packet *packet, const Ptr<const Iee
const IIeee80211Mode *RateSelection::computeResponseAckFrameMode(Packet *packet, const Ptr<const Ieee80211DataOrMgmtHeader>& dataOrMgmtHeader)
{
if (responseAckFrameMode)
return responseAckFrameMode;
return modeSet->getControlResponseMode(responseAckFrameMode);
else {
auto mode = getMode(packet, dataOrMgmtHeader);
ASSERT(modeSet->containsMode(mode));
return modeSet->getIsMandatory(mode) ? mode : modeSet->getSlowerMandatoryMode(mode); // TODO BSSBasicRateSet
auto responseModeSet = modeSet->getControlResponseModeSet(mode);
auto responseMode = responseModeSet->getMode(mode);
return responseModeSet->getIsMandatory(responseMode) ? responseMode : responseModeSet->getSlowerMandatoryMode(responseMode); // TODO BSSBasicRateSet
}
}

const IIeee80211Mode *RateSelection::computeResponseCtsFrameMode(Packet *packet, const Ptr<const Ieee80211RtsFrame>& rtsFrame)
{
if (responseCtsFrameMode)
return responseCtsFrameMode;
return modeSet->getControlResponseMode(responseCtsFrameMode);
else {
auto mode = getMode(packet, rtsFrame);
ASSERT(modeSet->containsMode(mode));
return modeSet->getIsMandatory(mode) ? mode : modeSet->getSlowerMandatoryMode(mode); // TODO BSSBasicRateSet
auto responseModeSet = modeSet->getControlResponseModeSet(mode);
auto responseMode = responseModeSet->getMode(mode);
return responseModeSet->getIsMandatory(responseMode) ? responseMode : responseModeSet->getSlowerMandatoryMode(responseMode); // TODO BSSBasicRateSet
}
}

Expand Down Expand Up @@ -170,4 +174,3 @@ void RateSelection::setFrameMode(Packet *packet, const Ptr<const Ieee80211MacHea

} // namespace ieee80211
} // namespace inet

Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ Ieee80211HtCompliantModes::~Ieee80211HtCompliantModes()
const Ieee80211HtMode *Ieee80211HtCompliantModes::getCompliantMode(const Ieee80211Htmcs *mcsMode, Ieee80211HtMode::BandMode centerFrequencyMode, Ieee80211HtPreambleMode::HighTroughputPreambleFormat preambleFormat, Ieee80211HtModeBase::GuardIntervalType guardIntervalType)
{
const char *name = ""; // TODO
auto htModeId = std::make_tuple(mcsMode->getBandwidth(), mcsMode->getMcsIndex(), guardIntervalType);
auto htModeId = std::make_tuple(mcsMode->getBandwidth(), mcsMode->getMcsIndex(), centerFrequencyMode, preambleFormat, guardIntervalType);
auto mode = singleton.modeCache.find(htModeId);
if (mode == singleton.modeCache.end()) {
const Ieee80211OfdmModulation *modulation = nullptr;
Expand All @@ -348,7 +348,7 @@ const Ieee80211HtMode *Ieee80211HtCompliantModes::getCompliantMode(const Ieee802
const Ieee80211HtDataMode *dataMode = new Ieee80211HtDataMode(mcsMode, mcsMode->getBandwidth(), guardIntervalType);
const Ieee80211HtPreambleMode *preambleMode = new Ieee80211HtPreambleMode(htSignal, legacySignal, preambleFormat, dataMode->getNumberOfSpatialStreams());
const Ieee80211HtMode *htMode = new Ieee80211HtMode(name, preambleMode, dataMode, centerFrequencyMode);
singleton.modeCache.insert(std::pair<std::tuple<Hz, unsigned int, Ieee80211HtModeBase::GuardIntervalType>, const Ieee80211HtMode *>(htModeId, htMode));
singleton.modeCache.emplace(htModeId, htMode);
return htMode;
}
return mode->second;
Expand Down Expand Up @@ -544,4 +544,3 @@ const DI<Ieee80211Htmcs> Ieee80211HtmcsTable::htMcs76BW40MHz([](){ return new Ie

} /* namespace physicallayer */
} /* namespace inet */

Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ class INET_API Ieee80211HtCompliantModes
protected:
static OPP_THREAD_LOCAL const Ieee80211HtCompliantModes singleton;

mutable std::map<std::tuple<Hz, unsigned int, Ieee80211HtModeBase::GuardIntervalType>, const Ieee80211HtMode *> modeCache;
mutable std::map<std::tuple<Hz, unsigned int, Ieee80211HtMode::BandMode, Ieee80211HtPreambleMode::HighTroughputPreambleFormat, Ieee80211HtModeBase::GuardIntervalType>, const Ieee80211HtMode *> modeCache;

public:
Ieee80211HtCompliantModes();
Expand All @@ -473,4 +473,3 @@ class INET_API Ieee80211HtCompliantModes
} /* namespace inet */

#endif

Loading