From 038ed89573d9b08308a7ddd3e94b846ac131b4d5 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 16 Mar 2023 05:33:55 -0700 Subject: [PATCH 001/434] Start RELEASE_NOTES.md and CHANGES.md sections for new release --- CHANGES.md | 11 +++++++++++ RELEASE_NOTES.md | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index dc4f605e1..f2518adbf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,17 @@ Note that users who upgrade the simulator across versions, or who work directly This file is a best-effort approach to solving this issue; we will do our best but can guarantee that there will be things that fall through the cracks, unfortunately. If you, as a user, can suggest improvements to this file based on your experience, please contribute a patch or drop us a note on ns-developers mailing list. +Changes from ns-3.38 to ns-3-dev +-------------------------------- + +### New API + +### Changes to existing API + +### Changes to build system + +### Changed behavior + Changes from ns-3.37 to ns-3.38 ------------------------------- diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 18f5c7f74..50e27ffcf 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -13,6 +13,15 @@ a [GitLab.com issue tracker](https://gitlab.com/nsnam/ns-3-dev/-/issues) number, and references prefixed by '!' refer to a [GitLab.com merge request](https://gitlab.com/nsnam/ns-3-dev/-/merge_requests) number. +Release 3-dev +------------- + +### Supported platforms + +### New user-visible features + +### Bugs fixed + Release 3.38 ------------ From cc2552a16672c7c3ea5441d6f2c50f8aaa383edf Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 16 Mar 2023 05:36:23 -0700 Subject: [PATCH 002/434] core: Add deprecated for ns-3.39 --- src/core/model/deprecated.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/model/deprecated.h b/src/core/model/deprecated.h index 701c59265..7401151ef 100644 --- a/src/core/model/deprecated.h +++ b/src/core/model/deprecated.h @@ -74,6 +74,13 @@ */ #define NS_DEPRECATED(msg) [[deprecated(msg)]] +/** + * \ingroup core + * \def NS_DEPRECATED_3_39 + * Tag for things deprecated in version ns-3.39. + */ +#define NS_DEPRECATED_3_39(msg) NS_DEPRECATED(msg) + /** * \ingroup core * \def NS_DEPRECATED_3_38 From 05af2f45e042c479e39715657203bb3079493f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Mon, 6 Mar 2023 14:21:21 +0100 Subject: [PATCH 003/434] Remove unused 'deprecated.h' includes --- src/core/model/type-id.h | 1 - src/internet/model/ipv6-header.h | 1 - src/network/model/packet.h | 1 - src/network/utils/data-rate.h | 1 - src/network/utils/ipv4-address.h | 1 - src/network/utils/ipv6-address.h | 1 - src/wave/helper/wifi-80211p-helper.h | 1 - src/wifi/helper/wifi-helper.h | 1 - 8 files changed, 8 deletions(-) diff --git a/src/core/model/type-id.h b/src/core/model/type-id.h index 250f6471f..c6d27801b 100644 --- a/src/core/model/type-id.h +++ b/src/core/model/type-id.h @@ -23,7 +23,6 @@ #include "attribute-helper.h" #include "attribute.h" #include "callback.h" -#include "deprecated.h" #include "hash.h" #include "trace-source-accessor.h" diff --git a/src/internet/model/ipv6-header.h b/src/internet/model/ipv6-header.h index 8f1dfc5df..1927e40df 100644 --- a/src/internet/model/ipv6-header.h +++ b/src/internet/model/ipv6-header.h @@ -20,7 +20,6 @@ #ifndef IPV6_HEADER_H #define IPV6_HEADER_H -#include "ns3/deprecated.h" #include "ns3/header.h" #include "ns3/ipv6-address.h" diff --git a/src/network/model/packet.h b/src/network/model/packet.h index f6d167d2a..b7aa073bc 100644 --- a/src/network/model/packet.h +++ b/src/network/model/packet.h @@ -30,7 +30,6 @@ #include "ns3/assert.h" #include "ns3/callback.h" -#include "ns3/deprecated.h" #include "ns3/mac48-address.h" #include "ns3/ptr.h" diff --git a/src/network/utils/data-rate.h b/src/network/utils/data-rate.h index d4f3ac2bc..c41790997 100644 --- a/src/network/utils/data-rate.h +++ b/src/network/utils/data-rate.h @@ -22,7 +22,6 @@ #include "ns3/attribute-helper.h" #include "ns3/attribute.h" -#include "ns3/deprecated.h" #include "ns3/nstime.h" #include diff --git a/src/network/utils/ipv4-address.h b/src/network/utils/ipv4-address.h index bc9652d1d..48edc99d7 100644 --- a/src/network/utils/ipv4-address.h +++ b/src/network/utils/ipv4-address.h @@ -22,7 +22,6 @@ #include "ns3/address.h" #include "ns3/attribute-helper.h" -#include "ns3/deprecated.h" #include #include diff --git a/src/network/utils/ipv6-address.h b/src/network/utils/ipv6-address.h index 6d4077aad..a9a8f8571 100644 --- a/src/network/utils/ipv6-address.h +++ b/src/network/utils/ipv6-address.h @@ -24,7 +24,6 @@ #include "ns3/address.h" #include "ns3/attribute-helper.h" -#include "ns3/deprecated.h" #include "ns3/ipv4-address.h" #include diff --git a/src/wave/helper/wifi-80211p-helper.h b/src/wave/helper/wifi-80211p-helper.h index a91ea82f5..3d60ba3fe 100644 --- a/src/wave/helper/wifi-80211p-helper.h +++ b/src/wave/helper/wifi-80211p-helper.h @@ -22,7 +22,6 @@ */ #ifndef WIFI_802_11P_HELPER_H #define WIFI_802_11P_HELPER_H -#include "ns3/deprecated.h" #include "ns3/wifi-helper.h" namespace ns3 diff --git a/src/wifi/helper/wifi-helper.h b/src/wifi/helper/wifi-helper.h index c17a09143..b934ee0dd 100644 --- a/src/wifi/helper/wifi-helper.h +++ b/src/wifi/helper/wifi-helper.h @@ -24,7 +24,6 @@ #include "wifi-mac-helper.h" -#include "ns3/deprecated.h" #include "ns3/qos-utils.h" #include "ns3/trace-helper.h" #include "ns3/wifi-phy.h" From 7786a55ec4762b4f8325764684c19f6fa6d7acdb Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Thu, 16 Mar 2023 11:51:48 +0900 Subject: [PATCH 004/434] network: Add Mac16Address constructor --- src/network/utils/mac16-address.cc | 6 ++++++ src/network/utils/mac16-address.h | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/network/utils/mac16-address.cc b/src/network/utils/mac16-address.cc index 0c4bb8453..76f373711 100644 --- a/src/network/utils/mac16-address.cc +++ b/src/network/utils/mac16-address.cc @@ -104,6 +104,12 @@ Mac16Address::Mac16Address(const char* str) NS_ASSERT(i == 2); } +Mac16Address::Mac16Address(uint16_t addr) +{ + m_address[1] = addr & 0xFF; + m_address[0] = (addr >> 8) & 0xFF; +} + void Mac16Address::CopyFrom(const uint8_t buffer[2]) { diff --git a/src/network/utils/mac16-address.h b/src/network/utils/mac16-address.h index bac6701f1..0d497727e 100644 --- a/src/network/utils/mac16-address.h +++ b/src/network/utils/mac16-address.h @@ -50,24 +50,34 @@ class Mac16Address */ Mac16Address(const char* str); + /** + * \param addr The 16 bit integer used to create a Mac16Address object. + * + * Create a Mac16Address from an 16 bit integer. + */ + Mac16Address(uint16_t addr); + /** * \param buffer address in network order * * Copy the input address to our internal buffer. */ void CopyFrom(const uint8_t buffer[2]); + /** * \param buffer address in network order * * Copy the internal address to the input buffer. */ void CopyTo(uint8_t buffer[2]) const; + /** * \returns a new Address instance * * Convert an instance of this class to a polymorphic Address instance. */ operator Address() const; + /** * \param address a polymorphic address * \returns a new Mac16Address from the polymorphic address @@ -77,6 +87,7 @@ class Mac16Address * Mac16Address. */ static Mac16Address ConvertFrom(const Address& address); + /** * \returns a new Address instance * @@ -89,6 +100,7 @@ class Mac16Address * \returns true if the address matches, false otherwise. */ static bool IsMatchingType(const Address& address); + /** * Allocate a new Mac16Address. * \returns newly allocated mac16Address From cb736ec3ebbbd4269ce532aaa03a4ece7fba20a6 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 17 Mar 2023 23:54:05 -0300 Subject: [PATCH 005/434] build: expose the installation docs option in the ns3 script --- ns3 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ns3 b/ns3 index 4bd72a653..54defbb22 100755 --- a/ns3 +++ b/ns3 @@ -282,7 +282,7 @@ def parse_args(argv): help='Try "./ns3 docs --help" for more documentation options') parser_docs.add_argument('docs', help='Build project documentation', - choices=["manual", "models", "tutorial", "contributing", + choices=["contributing", "installation", "manual", "models", "tutorial", "sphinx", "doxygen-no-build", "doxygen", "all"], action="store", type=str, default=None) @@ -794,7 +794,7 @@ def get_program_shortcuts(build_profile, ns3_version): ns3_program_map[shortcut_path] = [program] - # Add an additional shortcut with .exe suffix when running on Windows + # Add a shortcut with .exe suffix when running on Windows if sys.platform == "win32": ns3_program_map[shortcut_path.replace("\\", "/")] = [program] ns3_program_map[shortcut_path + ".exe"] = [program] @@ -1045,6 +1045,7 @@ def build_step(args, "docs", "doxygen", "doxygen-no-build", + "installation", "sphinx", "manual", "models", @@ -1063,7 +1064,7 @@ def build_step(args, target = get_target_to_build(target, ns3_version, build_profile) else: # Sphinx target should have the sphinx prefix - if target in ["contributing", "manual", "models", "tutorial"]: + if target in ["contributing", "installation", "manual", "models", "tutorial"]: target = "sphinx_%s" % target # Docs should build both doxygen and sphinx based docs From fa477e061ec3b6009a5a7be4f0ab9d4363c08503 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 17 Mar 2023 23:55:00 -0300 Subject: [PATCH 006/434] build: remove code intended for waf compatibility from the ns3 script --- ns3 | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/ns3 b/ns3 index 54defbb22..08deb28c6 100755 --- a/ns3 +++ b/ns3 @@ -1585,30 +1585,7 @@ def main(): output ) - def remove_overlapping_path(base_path, target_path): - """ - Remove overlapping paths from output directory and target_to_run - :param base_path: output path of the ns-3 build - :param target_path: path to the executable to run - :return: target_path without the overlapping parts - """ - target_path = target_path.replace('/', os.sep).split(os.sep) - base_path = base_path.replace('/', os.sep).split(os.sep) - while target_path[0] in base_path: - target_path = target_path[1:] - target_path = os.sep.join(target_path) - return target_path - if not args.shell and target_to_run and ".py" not in target_to_run: - target_to_run = remove_overlapping_path(out_dir, target_to_run) - - # Waf doesn't add version prefix and build type suffix to the scratches, so we remove them - if current_cmake_cache_folder is None: - if "scratch" in target_to_run and run_only: - waf_target_to_run = target_to_run.replace(os.path.basename(target_to_run), args.run) - if os.path.exists(os.sep.join([out_dir, waf_target_to_run])): - target_to_run = waf_target_to_run - target_to_run = os.sep.join([out_dir, target_to_run]) if sys.platform == "win32": target_to_run += ".exe" From 5cef90bc27e5c050e605915777d5eceff28a962f Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 17 Mar 2023 23:57:53 -0300 Subject: [PATCH 007/434] test: skip non-files when checking for dead urls in test-ns3.py --- utils/tests/test-ns3.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/tests/test-ns3.py b/utils/tests/test-ns3.py index 994d55401..8be19de99 100755 --- a/utils/tests/test-ns3.py +++ b/utils/tests/test-ns3.py @@ -2810,10 +2810,15 @@ class NS3QualityControlTestCase(unittest.TestCase): if "build" in root or "_static" in root or "source-temp" in root or 'html' in root: continue for file in files: + filepath = os.path.join(root, file) + + # skip everything that isn't a file + if not os.path.isfile(filepath): + continue + # skip svg files if file.endswith(".svg"): continue - filepath = os.path.join(root, file) try: with open(filepath, "r") as f: From 24459a62135dd8be2393f34815aaad9dbd5b9c93 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 18 Mar 2023 00:03:56 -0300 Subject: [PATCH 008/434] build: fix warning when python bindigns are disabled --- build-support/macros-and-definitions.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 865552fe0..6295021e7 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -856,10 +856,12 @@ macro(process_options) ) endif() else() - message( - ${HIGHLIGHTED_STATUS} - "Python: an incompatible version of Python was found, python bindings will be disabled" - ) + if(${NS3_PYTHON_BINDINGS}) + message( + ${HIGHLIGHTED_STATUS} + "Python: an incompatible version of Python was found, python bindings will be disabled" + ) + endif() endif() set(ENABLE_PYTHON_BINDINGS OFF) From 69de0bc4932590d4382cb023d4532cc81f1c4148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Fri, 17 Mar 2023 09:58:40 +0100 Subject: [PATCH 009/434] netanim: Add missing version updates a7bdcafed99849b84c898a12327ec0139396da0e didn't cover all. --- build-support/macros-and-definitions.cmake | 2 +- src/netanim/model/animation-interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 6295021e7..5d4e32ce9 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -1479,7 +1479,7 @@ macro(process_options) include(FetchContent) FetchContent_Declare( netanim GIT_REPOSITORY https://gitlab.com/nsnam/netanim.git - GIT_TAG netanim-3.108 + GIT_TAG netanim-3.109 ) FetchContent_Populate(netanim) file(COPY build-support/3rd-party/netanim-cmakelists.cmake diff --git a/src/netanim/model/animation-interface.h b/src/netanim/model/animation-interface.h index 30fffe451..95058ae65 100644 --- a/src/netanim/model/animation-interface.h +++ b/src/netanim/model/animation-interface.h @@ -50,7 +50,7 @@ namespace ns3 #define MAX_PKTS_PER_TRACE_FILE 100000 #define PURGE_INTERVAL 5 -#define NETANIM_VERSION "netanim-3.108" +#define NETANIM_VERSION "netanim-3.109" #define CHECK_STARTED_INTIMEWINDOW \ { \ if (!m_started || !IsInTimeWindow()) \ From eb3f436e26fb1c13b05bbbdd6c6e8363ad229660 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Thu, 23 Feb 2023 19:26:31 -0300 Subject: [PATCH 010/434] spell-check: expand regex to split up [c|C]amelCase and Snake_Case. --- .codespellrc | 3 ++- utils/tests/gitlab-ci-code-linting.yml | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index c428309c9..d63e5cad7 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,5 @@ [codespell] -skip = .git,.gitlab-ci-local,*.eps,*.pdf,*.css_t,AUTHORS +skip = .git,.gitlab-ci-local,*.eps,*.pdf,*.css_t,AUTHORS,*build*,*.mob ignore-words = ./utils/codespell-ignored-words exclude-file = ./utils/codespell-ignored-lines +regex = (? git_messages.txt + # Check source code and commit messages + - codespell -f -C0 ./ timeout: 1h From 540f48c55ac23316e84de5dcab1723e6a1282d18 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Thu, 23 Feb 2023 17:30:58 -0300 Subject: [PATCH 011/434] Fix additional typos --- CHANGES.md | 38 +- doc/manual/source/events.rst | 34 +- .../source/working-with-gitlab-ci-local.rst | 4 +- examples/matrix-topology/matrix-topology.cc | 6 +- examples/tcp/tcp-validation.cc | 2 +- src/aodv/model/aodv-rtable.h | 2 +- .../outdoor-group-mobility-example.cc | 2 +- .../helper/click-internet-stack-helper.cc | 2 +- src/core/model/attribute-accessor-helper.h | 2 +- src/core/model/config.cc | 2 +- src/core/model/matrix-array.h | 4 +- src/core/model/rng-seed-manager.h | 2 +- src/core/test/object-test-suite.cc | 2 +- src/dsr/model/dsr-option-header.cc | 40 +- src/dsr/model/dsr-option-header.h | 6 +- src/dsr/model/dsr-options.cc | 8 +- src/dsr/model/dsr-routing.cc | 14 +- src/energy/helper/energy-source-container.h | 2 +- src/energy/model/li-ion-energy-source.h | 2 +- src/energy/model/simple-device-energy-model.h | 2 +- src/internet/model/global-router-interface.cc | 50 +- src/internet/model/ipv6-header.h | 2 +- src/lr-wpan/examples/lr-wpan-per-plot.cc | 6 +- src/lr-wpan/model/lr-wpan-constants.h | 2 +- src/lr-wpan/model/lr-wpan-fields.cc | 14 +- src/lr-wpan/model/lr-wpan-mac.cc | 2 +- src/lr-wpan/model/lr-wpan-net-device.h | 6 +- src/lte/doc/source/lte-design.rst | 8 +- src/lte/helper/lte-helper.cc | 2 +- src/lte/model/epc-enb-application.h | 10 +- src/lte/model/epc-pgw-application.h | 2 +- src/lte/model/epc-sgw-application.h | 2 +- src/lte/model/ff-mac-common.h | 2 +- src/lte/model/lte-enb-mac.cc | 22 +- src/lte/model/lte-enb-mac.h | 4 +- src/lte/model/lte-enb-phy-sap.h | 4 +- src/lte/model/lte-enb-phy.cc | 2 +- src/lte/model/lte-fr-strict-algorithm.h | 2 +- src/lte/model/lte-rlc-am-header.h | 2 +- src/lte/model/lte-rrc-header.cc | 6 +- src/lte/model/lte-ue-cphy-sap.h | 8 +- src/lte/model/lte-ue-phy.cc | 6 +- src/lte/model/lte-ue-phy.h | 2 +- src/lte/model/lte-ue-rrc.cc | 2 +- src/lte/model/lte-ue-rrc.h | 2 +- src/lte/model/rr-ff-mac-scheduler.cc | 4 +- src/lte/test/lte-test-ipv6-routing.cc | 4 +- src/lte/test/test-lte-handover-failure.cc | 16 +- src/lte/test/test-lte-x2-handover.cc | 472 +++++++++++++----- src/mesh/model/dot11s/hwmp-protocol.h | 4 +- .../dot11s/peer-management-protocol-mac.h | 2 +- .../model/dot11s/peer-management-protocol.h | 4 +- .../reference-point-group-mobility-example.cc | 4 +- src/mpi/model/mpi-receiver.h | 2 +- src/mpi/model/null-message-simulator-impl.h | 6 +- src/network/examples/CMakeLists.txt | 2 +- ...omparisions.cc => lollipop-comparisons.cc} | 0 src/network/model/nix-vector.cc | 12 +- src/network/model/packet-metadata.cc | 4 +- src/network/model/packet-metadata.h | 4 +- src/network/model/packet.cc | 8 +- .../doc/point-to-point-dumbbell.rst | 2 +- src/propagation/model/jakes-process.cc | 6 +- src/sixlowpan/doc/sixlowpan.rst | 4 +- src/sixlowpan/model/sixlowpan-net-device.cc | 24 +- src/sixlowpan/model/sixlowpan-net-device.h | 2 +- src/spectrum/doc/spectrum.rst | 2 +- src/spectrum/model/spectrum-model.h | 2 +- src/stats/model/get-wildcard-matches.cc | 2 +- .../ns3tc/fq-cobalt-queue-disc-test-suite.cc | 2 +- .../ns3tc/fq-codel-queue-disc-test-suite.cc | 2 +- .../examples/fqcodel-l4s-example.cc | 2 +- src/wave/doc/wave.rst | 10 +- src/wave/model/ocb-wifi-mac.cc | 2 +- src/wave/model/ocb-wifi-mac.h | 2 +- src/wave/model/wave-net-device.cc | 2 +- src/wave/test/mac-extension-test-suite.cc | 6 +- src/wifi/model/he/rr-multi-user-scheduler.cc | 4 +- src/wifi/model/mgt-headers.cc | 8 +- src/wifi/model/mgt-headers.h | 4 +- .../model/rate-control/aparf-wifi-manager.cc | 12 +- .../model/rate-control/aparf-wifi-manager.h | 8 +- src/wifi/model/wifi-information-element.h | 2 +- src/wifi/model/wifi-radio-energy-model.h | 2 +- src/wifi/test/tx-duration-test.cc | 6 +- src/wimax/model/bs-net-device.cc | 2 +- src/wimax/model/bs-uplink-scheduler-rtps.cc | 2 +- src/wimax/model/cid-factory.h | 2 +- src/wimax/model/simple-ofdm-wimax-phy.cc | 16 +- src/wimax/model/simple-ofdm-wimax-phy.h | 2 +- src/wimax/model/ss-link-manager.cc | 6 +- src/wimax/model/ss-net-device.cc | 2 +- src/wimax/model/wimax-net-device.h | 2 +- utils/codespell-ignored-lines | 77 +++ utils/codespell-ignored-words | 6 + 95 files changed, 717 insertions(+), 412 deletions(-) rename src/network/examples/{lollipop-comparisions.cc => lollipop-comparisons.cc} (100%) diff --git a/CHANGES.md b/CHANGES.md index f2518adbf..6f4e46cb4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,28 @@ Changes from ns-3.38 to ns-3-dev ### Changes to existing API +* (dsr) The spelling of the class `DsrOptionRerrUnsupportHeader` from `dsr-option-header.h` was corrected to `DsrOptionRerrUnsupportedHeader`; this will affect existing users who were using the class with the misspelling. +* (internet) The spelling of the enumerated value `IPV6_EXT_AUTHENTIFICATION` from `ipv6-header.h` was corrected to `IPV6_EXT_AUTHENTICATION`; this will affect existing users who were using the enumerated value with the misspelling. +* (mesh) The spelling of the function `PeerManagementProtocolMac::SetPeerManagerProtcol` from `peer-management-protocol-mac.h` was corrected to `PeerManagementProtocolMac::SetPeerManagerProtocol`; this will affect existing users who were using the function with the misspelling. +* (lr-wpan) The spelling of the constant `aMaxBeaconPayloadLenght` from `lr-wpan-constants.h` was corrected to `aMaxBeaconPayloadLength`; this will affect existing users who were using the constant value with the misspelling. +* (lte) The spelling of the enumeration `ControPduType_t` from `lte-rlc-am-header.h` was corrected to `ControlPduType_t`; this will affect existing users who were using the enumeration with the misspelling. +* (lte) The spelling of the function `LteUeCphySapProvider::StartInSnycDetection()` from `lte-ue-cphy-sap.h` was corrected to `LteUeCphySapProvider::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (lte) The spelling of the function `MemberLteUeCphySapProvider::StartInSnycDetection()` from `lte-ue-cphy-sap.h` was corrected to `MemberLteUeCphySapProvider::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (lte) The spelling of the function `LteUePhy::StartInSnycDetection()` from `lte-ue-phy.h` was corrected to `LteUePhy::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (lte) The spelling of the function `DoUlInfoListElementHarqFeeback` from `lte-enb-phy-sap.h` and `lte-enb-mac.h` was corrected to `DoUlInfoListElementHarqFeedback`; this will affect existing users who were using the function with the mispelling. +* (lte) The spelling of the function `DoDlInfoListElementHarqFeeback` from `lte-enb-phy-sap.h` and `lte-enb-mac.h` was corrected to `DoDlInfoListElementHarqFeedback`; this will affect existing users who were using the function with the mispelling. +* (network) The spelling of the file `lollipop-comparisions.cc` was corrected to `lollipop-comparisons.cc`. +* (network) The spelling of the attribute `currentTrimedFromStart` from `packet-metadata.h` was corrected to `currentTrimmedFromStart`; this will affect existing users who were using the attribute with the misspelling. +* (network) The spelling of the attribute `currentTrimedFromEnd` from `packet-metadata.h` was corrected to `currentTrimmedFromEnd`; this will affect existing users who were using the attribute with the misspelling. +* (wave) The spelling of the function `OcbWifiMac::CancleTx()` from `ocb-wifi-mac.h` was corrected to `OcbWifiMac::CancelTx()`; this will affect existing users who were using the function with the misspelling. +* (wifi) The spelling of the attribute `m_succesMax1` from `aparf-wifi-manager.h` was corrected to `m_successMax1`; this will affect existing users who were using the attribute with the misspelling. +* (wifi) The spelling of the attribute `m_succesMax2` from `aparf-wifi-manager.h` was corrected to `m_successMax2`; this will affect existing users who were using the attribute with the misspelling. +* (wifi) The spelling of the enumerated value `MDAOP_ADVERTISMENT_REQUEST` from `mgmt-headers.h` was corrected to `MDAOP_ADVERTISEMENT_REQUEST`; this will affect existing users who were using the enumerated value with the misspelling. +* (wifi) The spelling of the enumerated value `MDAOP_ADVERTISMENTS` from `mgmt-headers.h` was corrected to `MDAOP_ADVERTISEMENTS`; this will affect existing users who were using the enumerated value with the misspelling. +* (wifi) The spelling of the define `IE_BEAMLINK_MAINENANCE` from `wifi-information-element.h` was corrected to `IE_BEAMLINK_MAINTENANCE`; this will affect existing users who were using the define with the misspelling. +* (wimax) The spelling of the attribute `m_nrRecivedFecBlocks` from `simple-ofdm-wimax-phy.h` was corrected to `m_nrReceivedFecBlocks`; this will affect existing users who were using the attribute with the misspelling. +* (sixlowpan) The spelling of the function `SixLowPanNetDevice::Fragments::GetFraments` from `sixlowpan-net-device.cc` was corrected to `SixLowPanNetDevice::Fragments::GetFragments`; this will affect existing users who were using the function with the misspelling. + ### Changes to build system ### Changed behavior @@ -411,7 +433,7 @@ Changes from ns-3.29 to ns-3.30 * A new attribute `WifiPhy::PostReceptionErrorModel` has been added to force specific packet drops. * A new attribute `WifiPhy::PreambleDetectionModel` has been added to decide whether PHY preambles are successfully detected. * New attributes `QosTxop::AddBaResponseTimeout` and `QosTxop::FailedAddBaTimeout` have been added to set the timeout to wait for an ADDBA response after the ACK to the ADDBA request is received and to set the timeout after a failed BA agreement, respectively. -* A new attribute `QosTxop::UseExpliciteBarAfterMissedBlockAck` has been added to specify whether explicit Block Ack Request should be sent upon missed Block Ack Response. +* A new attribute `QosTxop::UseExplicitBarAfterMissedBlockAck` has been added to specify whether explicit Block Ack Request should be sent upon missed Block Ack Response. * Added a new trace source `EndOfHePreamble` in WifiPhy for tracing end of preamble (after training fields) for received 802.11ax packets. * Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the **frame capture model**. * Added a new helper method to SpectrumWifiPhyHelper and YansWifiPhyHelper to set the **preamble detection model**. @@ -598,12 +620,12 @@ Changes from ns-3.26 to ns-3.27 * A new standard value has been added that enables the new 11ax data rates. * A new 11ax preamble has been added. * A new attribute was added to configure the guard interval duration for High Efficiency (HE) PHY entities. This attribute can be set using the YansWifiPhyHelper. -* A new information element has been added: HeCapabilities. This information element is added to the MAC frame header if the node is a HE node. This HeCapabilites information element is used to advertise the HE capabilities of the node to other nodes in the network. +* A new information element has been added: HeCapabilities. This information element is added to the MAC frame header if the node is a HE node. This HeCapabilities information element is used to advertise the HE capabilities of the node to other nodes in the network. * A new class were added for the RRPAA WiFi rate control mechanism. * Included carrier aggregation feature in LTE module * LTE model is extended to support carrier aggregation feature according to 3GPP Release 10, for up to 5 component carriers. -* InstallSingleEnbDevice and InstalSingeUeDevice functions of LteHelper are now constructing LteEnbDevice and LteUeDevice according to CA architecture. Each device, UE and eNodeB contains an instance of component carrier manager, and may have several component carrier instances. +* InstallSingleEnbDevice and InstallSingleUeDevice functions of LteHelper are now constructing LteEnbDevice and LteUeDevice according to CA architecture. Each device, UE and eNodeB contains an instance of component carrier manager, and may have several component carrier instances. * SAP interfaces are extended to include CA message exchange functionality. * RRC connection procedure is extended to allow RRC connection reconfiguration for the configuration of the secondary carriers. * RRC measurement reporting is extended to allow measurement reporting from the secondary carriers. @@ -755,7 +777,7 @@ Changes from ns-3.23 to ns-3.24 * A new helper (VhtWifiMacHelper) was added to set up a Very high throughput (VHT) MAC entity. * A new standard value has been added that enables the new 11ac data rates. * A new 11ac preamble has been added. -* A new information element has been added: VhtCapabilities. This information element is added to the MAC frame header if the node is a VHT node. This VhtCapabilites information element is used to advertise the VHT capabilities of the node to other nodes in the network. +* A new information element has been added: VhtCapabilities. This information element is added to the MAC frame header if the node is a VHT node. This VhtCapabilities information element is used to advertise the VHT capabilities of the node to other nodes in the network. * The ArpCache API was extended to allow the manual removal of ArpCache entries and the addition of permanent (static) entries for IPv4. * The SimpleChannel in the `network` module now allows per-NetDevice blacklists, in order to do hidden terminal testcases. @@ -848,7 +870,7 @@ Changes from ns-3.20 to ns-3.21 * New `const double& SpectrumValue::operator[] (size_t index) const`. * A new TraceSource has been added to TCP sockets: SlowStartThreshold. -* New method CommandLine::AddValue (name, attibutePath) to provide a shorthand argument `name` for the Attribute `path`. This also has the effect of including the help string for the Attribute in the Usage message. +* New method CommandLine::AddValue (name, attributePath) to provide a shorthand argument `name` for the Attribute `path`. This also has the effect of including the help string for the Attribute in the Usage message. * The GSoC 2014 project in the LTE module has brought some additional APIs: * a new abstract class LteFfrAlgorithm, which every future implementation of frequency reuse algorithm should inherit from * a new SAPs: one between MAC Scheduler and FrAlgorithm, one between RRC and FrAlgorithm @@ -999,7 +1021,7 @@ Changes from ns-3.17 to ns-3.18 * New attributes were added to help the user setup a High Throughput (HT) PHY entity. These attributes can be set using the YansWifiPhyHelper * A new standard value has been added that enables the new 11n data rates. * New 11n preambles has been added (Mixed format and greenfield). To be able to change Tx duration according to the preamble used, a new class TxVector has been added to carry the transmission parameters (mode, preamble, stbc,..). Several functions have been updated to allow the passage of TxVector instead of WifiMode in MacLow, WifiRemoteStationManager, WifiPhy, YansWifiPhy,.. - * A new information element has been added: HTCapabilities. This information element is added to the MAC frame header if the node is an HT node. This HTCapabilites information element is used to advertise the HT capabilities of the node to other nodes in the network + * A new information element has been added: HTCapabilities. This information element is added to the MAC frame header if the node is an HT node. This HTCapabilities information element is used to advertise the HT capabilities of the node to other nodes in the network * InternetStackHelper has two new functions:SetIpv4ArpJitter (bool enable) and SetIpv6NsRsJitter (bool enable) to enable/disable the random jitter on the transmission of IPv4 ARP Request and IPv6 NS/RS. * Bounds on valid time inputs for time attributes can now be enabled. See attribute-test-suite.cc for an example. * New generic hash function interface provided in the simulation core. Two hash functions are provided: murmur3 (default), and the venerable FNV1a. See the Hash Functions section in the ns-3 manual. @@ -1068,7 +1090,7 @@ Changes from ns-3.16 to ns-3.17 * New DSR API * Added PassiveBuffer class to save maintenance packet entry for passive acknowledgment option * Added FindSourceEntry function in RreqTable class to keep track of route request entry received from same source node - * Added NotifyDataReciept function in DsrRouting class to notify the data receipt of the next hop from link layer. This is used for the link layer acknowledgment. + * Added NotifyDataReceipt function in DsrRouting class to notify the data receipt of the next hop from link layer. This is used for the link layer acknowledgment. * New Tag, PacketSocketTag, to carry the destination address of a packet and the packet type * New Tag, DeviceNameTag, to carry the ns-3 device name from where a packet is coming * New Error Model, BurstError model, to determine which bursts of packets are errored corresponding to an underlying distribution, burst rate, and burst size @@ -1102,7 +1124,7 @@ Changes from ns-3.16 to ns-3.17 * LteEnbPhy new methods GetLteEnbCphySapProvider, SetLteEnbCphySapUser, GetDlSpectrumPhy, GetUlSpectrumPhy, CreateSrsReport * LteEnbPhy methods DoSendMacPdu, DoSetTransmissionMode, DoSetSrsConfigurationIndex, DoGetMacChTtiDelay, DoSendLteControlMessage, AddUePhy, DeleteUePhy made private * LteEnbPhySapProvider removed methods SetBandwidth, SetTransmissionMode, SetSrsConfigurationIndex, SetCellId - * LteEnbPhySapUser added methods ReceiveRachPreamble, UlInfoListElementHarqFeeback, DlInfoListElementHarqFeeback + * LteEnbPhySapUser added methods ReceiveRachPreamble, UlInfoListElementHarqFeedback, DlInfoListElementHarqFeedback * LtePdcp added methods (Set/Get)Status * LtePdcp DoTransmitRrcPdu renamed DoTransmitPdcpSdu * LteUeRrc new enum State. New methods SetLteUeCphySapProvider, GetLteUeCphySapUser, SetLteUeRrcSapUser, GetLteUeRrcSapProvider, GetState, GetDlEarfcn, GetDlBandwidth, GetUlBandwidth, GetCellId, SetUseRlcSm . GetRnti made const. diff --git a/doc/manual/source/events.rst b/doc/manual/source/events.rst index b77c03db6..a7c39dd7b 100644 --- a/doc/manual/source/events.rst +++ b/doc/manual/source/events.rst @@ -326,20 +326,20 @@ complexity on `Insert()` and `RemoveNext()`, are listed in the following table. See the individual Scheduler API pages for details on the complexity of the other API calls. -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| Scheduler Type | Complexity | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| | | Time | Space | -| `SchedulerImpl` Type | Method +-------------+--------------+----------+--------------+ -| | | Insert() | RemoveNext() | Overhead | Per Event | -+=======================+=====================================+=============+==============+==========+==============+ -| CalendarScheduler | ` []` | Constant | Constant | 24 bytes | 16 bytes | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| HeapScheduler | Heap on `std::vector` | Logarithmic | Logarithmic | 24 bytes | 0 | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| ListScheduler | `std::list` | Linear | Constant | 24 bytes | 16 bytes | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| MapScheduler | `st::map` | Logarithmic | Constant | 40 bytes | 32 bytes | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ -| PriorityQueueSchduler | `std::priority_queue<,std::vector>` | Logarithimc | Logarithims | 24 bytes | 0 | -+-----------------------+-------------------------------------+-------------+--------------+----------+--------------+ ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| Scheduler Type | Complexity | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| | | Time | Space | +| `SchedulerImpl` Type | Method +-------------+--------------+----------+--------------+ +| | | Insert() | RemoveNext() | Overhead | Per Event | ++========================+=====================================+=============+==============+==========+==============+ +| CalendarScheduler | ` []` | Constant | Constant | 24 bytes | 16 bytes | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| HeapScheduler | Heap on `std::vector` | Logarithmic | Logarithmic | 24 bytes | 0 | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| ListScheduler | `std::list` | Linear | Constant | 24 bytes | 16 bytes | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| MapScheduler | `st::map` | Logarithmic | Constant | 40 bytes | 32 bytes | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ +| PriorityQueueScheduler | `std::priority_queue<,std::vector>` | Logarithimc | Logarithims | 24 bytes | 0 | ++------------------------+-------------------------------------+-------------+--------------+----------+--------------+ diff --git a/doc/manual/source/working-with-gitlab-ci-local.rst b/doc/manual/source/working-with-gitlab-ci-local.rst index 0d76cde9f..6dec6a81b 100644 --- a/doc/manual/source/working-with-gitlab-ci-local.rst +++ b/doc/manual/source/working-with-gitlab-ci-local.rst @@ -5,7 +5,7 @@ Working with gitlab-ci-local ---------------------------- -.. _continuos integration (CI) : https://docs.gitlab.com/ee/ci/ +.. _continuous integration (CI) : https://docs.gitlab.com/ee/ci/ .. _pipelines : https://docs.gitlab.com/ee/ci/introduction/index.html#continuous-integration .. _daily and weekly pipelines : https://gitlab.com/nsnam/ns-3-dev/-/pipeline_schedules .. _crypto miners abuse : https://about.gitlab.com/blog/2021/05/17/prevent-crypto-mining-abuse/ @@ -15,7 +15,7 @@ Working with gitlab-ci-local .. _rootless mode : https://docs.docker.com/engine/security/rootless/ The ns-3 project repository is currently hosted in GitLab, which includes -`continuos integration (CI)`_ tools to automate build, tests, packaging and +`continuous integration (CI)`_ tools to automate build, tests, packaging and distribution of software. The CI works based on jobs, that are defined on YAML files. diff --git a/examples/matrix-topology/matrix-topology.cc b/examples/matrix-topology/matrix-topology.cc index 0cfaa302b..9c1cf4f22 100644 --- a/examples/matrix-topology/matrix-topology.cc +++ b/examples/matrix-topology/matrix-topology.cc @@ -60,7 +60,7 @@ using namespace ns3; // ---------- Prototypes ------------------------------------------------------ std::vector> readNxNMatrix(std::string adj_mat_file_name); -std::vector> readCordinatesFile(std::string node_coordinates_file_name); +std::vector> readCoordinatesFile(std::string node_coordinates_file_name); void printCoordinateArray(const char* description, std::vector> coord_array); void printMatrix(const char* description, std::vector> array); @@ -115,7 +115,7 @@ main(int argc, char* argv[]) // ---------- Read Node Coordinates File ----------------------------------- std::vector> coord_array; - coord_array = readCordinatesFile(node_coordinates_file_name); + coord_array = readCoordinatesFile(node_coordinates_file_name); // Optionally display node coordinates file // printCoordinateArray (node_coordinates_file_name.c_str (),coord_array); @@ -361,7 +361,7 @@ readNxNMatrix(std::string adj_mat_file_name) } std::vector> -readCordinatesFile(std::string node_coordinates_file_name) +readCoordinatesFile(std::string node_coordinates_file_name) { std::ifstream node_coordinates_file; node_coordinates_file.open(node_coordinates_file_name, std::ios::in); diff --git a/examples/tcp/tcp-validation.cc b/examples/tcp/tcp-validation.cc index 7aed2a009..0ba5774dd 100644 --- a/examples/tcp/tcp-validation.cc +++ b/examples/tcp/tcp-validation.cc @@ -933,7 +933,7 @@ main(int argc, char* argv[]) proto->SetAttribute("SocketType", TypeIdValue(secondTcpTypeId)); } - // InternetStackHelper will install a base TrafficControLayer on the node, + // InternetStackHelper will install a base TrafficControlLayer on the node, // but the Ipv4AddressHelper below will install the default FqCoDelQueueDisc // on all single device nodes. The below code overrides the configuration // that is normally done by the Ipv4AddressHelper::Install() method by diff --git a/src/aodv/model/aodv-rtable.h b/src/aodv/model/aodv-rtable.h index ac65e21c8..dfe52fe58 100644 --- a/src/aodv/model/aodv-rtable.h +++ b/src/aodv/model/aodv-rtable.h @@ -407,7 +407,7 @@ class RoutingTableEntry /// List of precursors std::vector m_precursorList; /// When I can send another request - Time m_routeRequestTimout; + Time m_routeRequestTimeout; /// Number of route requests uint8_t m_reqCount; /// Indicate if this entry is in "blacklist" diff --git a/src/buildings/examples/outdoor-group-mobility-example.cc b/src/buildings/examples/outdoor-group-mobility-example.cc index 6f59bca76..e7ccfa54b 100644 --- a/src/buildings/examples/outdoor-group-mobility-example.cc +++ b/src/buildings/examples/outdoor-group-mobility-example.cc @@ -196,7 +196,7 @@ main(int argc, char* argv[]) outdoorMm->SetPosition(Vector(10, 10, 0)); streamIndex += outdoorMm->AssignStreams(streamIndex); - // Each HierachicalMobilityModel contains the above model as the Parent, + // Each HierarchicalMobilityModel contains the above model as the Parent, // and a user defined model as the Child. Two MobilityModel objects are // instantiated per node, and each node also shares the same parent model. diff --git a/src/click/helper/click-internet-stack-helper.cc b/src/click/helper/click-internet-stack-helper.cc index ee800ddc3..fda4ba901 100644 --- a/src/click/helper/click-internet-stack-helper.cc +++ b/src/click/helper/click-internet-stack-helper.cc @@ -488,7 +488,7 @@ ClickInternetStackHelper::EnableAsciiIpv4Internal(Ptr strea "Drop", MakeBoundCallback(&Ipv4L3ProtocolDropSinkWithoutContext, theStream)); NS_ASSERT_MSG(result == true, - "ClickInternetStackHelper::EanableAsciiIpv4Internal(): " + "ClickInternetStackHelper::EnableAsciiIpv4Internal(): " "Unable to connect ipv4L3Protocol \"Drop\""); } diff --git a/src/core/model/attribute-accessor-helper.h b/src/core/model/attribute-accessor-helper.h index 1beccfbc5..e9f1e9f1c 100644 --- a/src/core/model/attribute-accessor-helper.h +++ b/src/core/model/attribute-accessor-helper.h @@ -247,7 +247,7 @@ template inline Ptr DoMakeAccessorHelperOne(U T::*memberVariable) { - /* AttributeAcessor implementation for a class member variable. */ + /* AttributeAccessor implementation for a class member variable. */ class MemberVariable : public AccessorHelper { public: diff --git a/src/core/model/config.cc b/src/core/model/config.cc index 566984ad5..668987d91 100644 --- a/src/core/model/config.cc +++ b/src/core/model/config.cc @@ -638,7 +638,7 @@ class ConfigImpl : public Singleton { public: // Keep Set and SetFailSafe since their errors are triggered - // by the underlying ObjecBase functions. + // by the underlying ObjectBase functions. /** \copydoc ns3::Config::Set() */ void Set(std::string path, const AttributeValue& value); /** \copydoc ns3::Config::SetFailSafe() */ diff --git a/src/core/model/matrix-array.h b/src/core/model/matrix-array.h index 7bfab6b2c..24534d6a0 100644 --- a/src/core/model/matrix-array.h +++ b/src/core/model/matrix-array.h @@ -179,13 +179,13 @@ class MatrixArray : public ValArray /** * \brief operator+ definition for MatrixArray. * \param rhs The rhs MatrixArray object - * \returns The result of operator+ of this MatrixArray and rhs MatrixAray + * \returns The result of operator+ of this MatrixArray and rhs MatrixArray */ MatrixArray operator+(const MatrixArray& rhs) const; /** * \brief binary operator- definition for MatrixArray. * \param rhs The rhs MatrixArray object - * \returns The result of operator- of this MatrixArray and rhs MatrixAray + * \returns The result of operator- of this MatrixArray and rhs MatrixArray */ MatrixArray operator-(const MatrixArray& rhs) const; /** diff --git a/src/core/model/rng-seed-manager.h b/src/core/model/rng-seed-manager.h index 7681b3f42..a44f1b4c2 100644 --- a/src/core/model/rng-seed-manager.h +++ b/src/core/model/rng-seed-manager.h @@ -46,7 +46,7 @@ class RngSeedManager * subsequently instantiated RandomVariableStream objects. * * \code - * RngSeedManger::SetSeed(15); + * RngSeedManager::SetSeed(15); * UniformVariable x(2,3); // These will give the same output every time * ExponentialVariable y(120); // as long as the seed stays the same. * \endcode diff --git a/src/core/test/object-test-suite.cc b/src/core/test/object-test-suite.cc index abf3fbce1..76032ab68 100644 --- a/src/core/test/object-test-suite.cc +++ b/src/core/test/object-test-suite.cc @@ -541,7 +541,7 @@ ObjectFactoryTestCase::DoRun() // // Since a declared a BaseA, even if it is really a DerivedA, we should not - // be able to GetOBject for a DerivedA since this would break the type + // be able to GetObject for a DerivedA since this would break the type // declaration. // NS_TEST_ASSERT_MSG_EQ(!a->GetObject(), diff --git a/src/dsr/model/dsr-option-header.cc b/src/dsr/model/dsr-option-header.cc index f12d092ac..7d1e95aba 100644 --- a/src/dsr/model/dsr-option-header.cc +++ b/src/dsr/model/dsr-option-header.cc @@ -1018,25 +1018,25 @@ DsrOptionRerrUnreachHeader::GetAlignment() const return retVal; } -NS_OBJECT_ENSURE_REGISTERED(DsrOptionRerrUnsupportHeader); +NS_OBJECT_ENSURE_REGISTERED(DsrOptionRerrUnsupportedHeader); TypeId -DsrOptionRerrUnsupportHeader::GetTypeId() +DsrOptionRerrUnsupportedHeader::GetTypeId() { - static TypeId tid = TypeId("ns3::dsr::DsrOptionRerrUnsupportHeader") - .AddConstructor() + static TypeId tid = TypeId("ns3::dsr::DsrOptionRerrUnsupportedHeader") + .AddConstructor() .SetParent() .SetGroupName("Dsr"); return tid; } TypeId -DsrOptionRerrUnsupportHeader::GetInstanceTypeId() const +DsrOptionRerrUnsupportedHeader::GetInstanceTypeId() const { return GetTypeId(); } -DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader() +DsrOptionRerrUnsupportedHeader::DsrOptionRerrUnsupportedHeader() : m_salvage(0) { SetType(3); @@ -1044,60 +1044,60 @@ DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader() SetErrorType(3); } -DsrOptionRerrUnsupportHeader::~DsrOptionRerrUnsupportHeader() +DsrOptionRerrUnsupportedHeader::~DsrOptionRerrUnsupportedHeader() { } void -DsrOptionRerrUnsupportHeader::SetSalvage(uint8_t salvage) +DsrOptionRerrUnsupportedHeader::SetSalvage(uint8_t salvage) { m_salvage = salvage; } uint8_t -DsrOptionRerrUnsupportHeader::GetSalvage() const +DsrOptionRerrUnsupportedHeader::GetSalvage() const { return m_salvage; } void -DsrOptionRerrUnsupportHeader::SetErrorSrc(Ipv4Address errorSrcAddress) +DsrOptionRerrUnsupportedHeader::SetErrorSrc(Ipv4Address errorSrcAddress) { m_errorSrcAddress = errorSrcAddress; } Ipv4Address -DsrOptionRerrUnsupportHeader::GetErrorSrc() const +DsrOptionRerrUnsupportedHeader::GetErrorSrc() const { return m_errorSrcAddress; } void -DsrOptionRerrUnsupportHeader::SetErrorDst(Ipv4Address errorDstAddress) +DsrOptionRerrUnsupportedHeader::SetErrorDst(Ipv4Address errorDstAddress) { m_errorDstAddress = errorDstAddress; } Ipv4Address -DsrOptionRerrUnsupportHeader::GetErrorDst() const +DsrOptionRerrUnsupportedHeader::GetErrorDst() const { return m_errorDstAddress; } void -DsrOptionRerrUnsupportHeader::SetUnsupported(uint16_t unsupported) +DsrOptionRerrUnsupportedHeader::SetUnsupported(uint16_t unsupported) { m_unsupported = unsupported; } uint16_t -DsrOptionRerrUnsupportHeader::GetUnsupported() const +DsrOptionRerrUnsupportedHeader::GetUnsupported() const { return m_unsupported; } void -DsrOptionRerrUnsupportHeader::Print(std::ostream& os) const +DsrOptionRerrUnsupportedHeader::Print(std::ostream& os) const { os << "( type = " << (uint32_t)GetType() << " length = " << (uint32_t)GetLength() << " errorType = " << (uint32_t)m_errorType << " salvage = " << (uint32_t)m_salvage @@ -1106,13 +1106,13 @@ DsrOptionRerrUnsupportHeader::Print(std::ostream& os) const } uint32_t -DsrOptionRerrUnsupportHeader::GetSerializedSize() const +DsrOptionRerrUnsupportedHeader::GetSerializedSize() const { return 16; } void -DsrOptionRerrUnsupportHeader::Serialize(Buffer::Iterator start) const +DsrOptionRerrUnsupportedHeader::Serialize(Buffer::Iterator start) const { Buffer::Iterator i = start; @@ -1126,7 +1126,7 @@ DsrOptionRerrUnsupportHeader::Serialize(Buffer::Iterator start) const } uint32_t -DsrOptionRerrUnsupportHeader::Deserialize(Buffer::Iterator start) +DsrOptionRerrUnsupportedHeader::Deserialize(Buffer::Iterator start) { Buffer::Iterator i = start; @@ -1142,7 +1142,7 @@ DsrOptionRerrUnsupportHeader::Deserialize(Buffer::Iterator start) } DsrOptionHeader::Alignment -DsrOptionRerrUnsupportHeader::GetAlignment() const +DsrOptionRerrUnsupportedHeader::GetAlignment() const { Alignment retVal = {4, 0}; return retVal; diff --git a/src/dsr/model/dsr-option-header.h b/src/dsr/model/dsr-option-header.h index 86fe5ad0d..b1be00246 100644 --- a/src/dsr/model/dsr-option-header.h +++ b/src/dsr/model/dsr-option-header.h @@ -1028,7 +1028,7 @@ class DsrOptionRerrUnreachHeader : public DsrOptionRerrHeader \endverbatim */ -class DsrOptionRerrUnsupportHeader : public DsrOptionRerrHeader +class DsrOptionRerrUnsupportedHeader : public DsrOptionRerrHeader { public: /** @@ -1044,11 +1044,11 @@ class DsrOptionRerrUnsupportHeader : public DsrOptionRerrHeader /** * \brief Constructor. */ - DsrOptionRerrUnsupportHeader(); + DsrOptionRerrUnsupportedHeader(); /** * \brief Destructor. */ - ~DsrOptionRerrUnsupportHeader() override; + ~DsrOptionRerrUnsupportedHeader() override; /** * \brief Set the route error source address * \param errorSrcAddress The error source address diff --git a/src/dsr/model/dsr-options.cc b/src/dsr/model/dsr-options.cc index 08bfdb3e4..600933d87 100644 --- a/src/dsr/model/dsr-options.cc +++ b/src/dsr/model/dsr-options.cc @@ -1634,12 +1634,12 @@ DsrOptionRerr::Process(Ptr packet, /* * Remove the route error header from the packet, and get the error type */ - DsrOptionRerrUnsupportHeader rerrUnsupport; - p->RemoveHeader(rerrUnsupport); + DsrOptionRerrUnsupportedHeader rerrUnsupported; + p->RemoveHeader(rerrUnsupported); /// \todo This is for the other two error options, not supporting for now - // uint32_t rerrSize = rerrUnsupport.GetSerializedSize(); - // uint32_t serialized = DoSendError (p, rerrUnsupport, rerrSize, ipv4Address, protocol); + // uint32_t rerrSize = rerrUnsupported.GetSerializedSize(); + // uint32_t serialized = DoSendError (p, rerrUnsupported, rerrSize, ipv4Address, protocol); uint32_t serialized = 0; return serialized; } diff --git a/src/dsr/model/dsr-routing.cc b/src/dsr/model/dsr-routing.cc index e4a1c4825..b951cc59d 100644 --- a/src/dsr/model/dsr-routing.cc +++ b/src/dsr/model/dsr-routing.cc @@ -3720,21 +3720,21 @@ DsrRouting::Receive(Ptr p, const Ipv4Header& ip, Ptr inco */ uint8_t salvage = 0; - DsrOptionRerrUnsupportHeader rerrUnsupportHeader; - rerrUnsupportHeader.SetErrorType(3); // The error type 3 means Option not supported - rerrUnsupportHeader.SetErrorSrc( + DsrOptionRerrUnsupportedHeader rerrUnsupportedHeader; + rerrUnsupportedHeader.SetErrorType(3); // The error type 3 means Option not supported + rerrUnsupportedHeader.SetErrorSrc( m_mainAddress); // The error source address is our own address - rerrUnsupportHeader.SetUnsupported(optionType); // The unsupported option type number - rerrUnsupportHeader.SetErrorDst( + rerrUnsupportedHeader.SetUnsupported(optionType); // The unsupported option type number + rerrUnsupportedHeader.SetErrorDst( src); // Error destination address is the destination of the data packet - rerrUnsupportHeader.SetSalvage( + rerrUnsupportedHeader.SetSalvage( salvage); // Set the value about whether to salvage a packet or not /* * The unknown option error is not supported currently in this implementation, and it's also * not likely to happen in simulations */ - // SendError (rerrUnsupportHeader, 0, protocol); // Send the error packet + // SendError (rerrUnsupportedHeader, 0, protocol); // Send the error packet } return IpL4Protocol::RX_OK; } diff --git a/src/energy/helper/energy-source-container.h b/src/energy/helper/energy-source-container.h index 1ae8ff011..d955f57c8 100644 --- a/src/energy/helper/energy-source-container.h +++ b/src/energy/helper/energy-source-container.h @@ -63,7 +63,7 @@ class EnergySourceContainer : public Object /** * \param source Pointer to an EnergySource. * - * Creates an EnergySourceContianer with exactly one EnergySource previously + * Creates an EnergySourceContainer with exactly one EnergySource previously * instantiated. */ EnergySourceContainer(Ptr source); diff --git a/src/energy/model/li-ion-energy-source.h b/src/energy/model/li-ion-energy-source.h index 78e24cb9e..24d2e36be 100644 --- a/src/energy/model/li-ion-energy-source.h +++ b/src/energy/model/li-ion-energy-source.h @@ -46,7 +46,7 @@ namespace ns3 * * * The model requires several parameters to approximates the discharge curves: - * - IntialCellVoltage, maximum voltage of the fully charged cell + * - InitialCellVoltage, maximum voltage of the fully charged cell * - NominalCellVoltage, nominal cell's voltage, is used to determine the end of the * nominal zone. * - ExpCellVoltage, cell's voltage at the end of the exponential zone diff --git a/src/energy/model/simple-device-energy-model.h b/src/energy/model/simple-device-energy-model.h index 633238024..a3fdd287a 100644 --- a/src/energy/model/simple-device-energy-model.h +++ b/src/energy/model/simple-device-energy-model.h @@ -65,7 +65,7 @@ class SimpleDeviceEnergyModel : public DeviceEnergyModel virtual Ptr GetNode() const; /** - * \brief Sets pointer to EnergySouce installed on node. + * \brief Sets pointer to EnergySource installed on node. * * \param source Pointer to EnergySource installed on node. * diff --git a/src/internet/model/global-router-interface.cc b/src/internet/model/global-router-interface.cc index 16d7a2cf0..f6bafd730 100644 --- a/src/internet/model/global-router-interface.cc +++ b/src/internet/model/global-router-interface.cc @@ -831,29 +831,29 @@ GlobalRouter::ProcessSingleBroadcastLink(Ptr nd, // case. // ClearBridgesVisited(); - Ipv4Address desigRtr; - desigRtr = FindDesignatedRouterForLink(nd); + Ipv4Address designatedRtr; + designatedRtr = FindDesignatedRouterForLink(nd); // // Let's double-check that any designated router we find out on our // network is really on our network. // - if (desigRtr != "255.255.255.255") + if (designatedRtr != "255.255.255.255") { Ipv4Address networkHere = addrLocal.CombineMask(maskLocal); - Ipv4Address networkThere = desigRtr.CombineMask(maskLocal); + Ipv4Address networkThere = designatedRtr.CombineMask(maskLocal); NS_ABORT_MSG_UNLESS( networkHere == networkThere, "GlobalRouter::ProcessSingleBroadcastLink(): Network number confusion (" - << addrLocal << "/" << maskLocal.GetPrefixLength() << ", " << desigRtr << "/" - << maskLocal.GetPrefixLength() << ")"); + << addrLocal << "/" << maskLocal.GetPrefixLength() << ", " << designatedRtr + << "/" << maskLocal.GetPrefixLength() << ")"); } - if (desigRtr == addrLocal) + if (designatedRtr == addrLocal) { c.Add(nd); NS_LOG_LOGIC("Node " << node->GetId() << " elected a designated router"); } - plr->SetLinkId(desigRtr); + plr->SetLinkId(designatedRtr); // // OSPF says that the Link Data is this router's own IP address. @@ -921,7 +921,7 @@ GlobalRouter::ProcessBridgedBroadcastLink(Ptr nd, // bool areTransitNetwork = false; - Ipv4Address desigRtr ("255.255.255.255"); + Ipv4Address designatedRtr ("255.255.255.255"); for (uint32_t i = 0; i < bnd->GetNBridgePorts (); ++i) { @@ -945,24 +945,24 @@ GlobalRouter::ProcessBridgedBroadcastLink(Ptr nd, // all. // ClearBridgesVisited (); - Ipv4Address desigRtrTemp = FindDesignatedRouterForLink (ndTemp); + Ipv4Address designatedRtrTemp = FindDesignatedRouterForLink (ndTemp); // // Let's double-check that any designated router we find out on our // network is really on our network. // - if (desigRtrTemp != "255.255.255.255") + if (designatedRtrTemp != "255.255.255.255") { Ipv4Address networkHere = addrLocal.CombineMask (maskLocal); - Ipv4Address networkThere = desigRtrTemp.CombineMask (maskLocal); + Ipv4Address networkThere = designatedRtrTemp.CombineMask (maskLocal); NS_ABORT_MSG_UNLESS (networkHere == networkThere, "GlobalRouter::ProcessSingleBroadcastLink(): Network number confusion (" << addrLocal << "/" << maskLocal.GetPrefixLength () << ", " << - desigRtrTemp << "/" << maskLocal.GetPrefixLength () << ")"); + designatedRtrTemp << "/" << maskLocal.GetPrefixLength () << ")"); } - if (desigRtrTemp < desigRtr) + if (designatedRtrTemp < designatedRtr) { - desigRtr = desigRtrTemp; + designatedRtr = designatedRtrTemp; } } } @@ -1013,12 +1013,12 @@ GlobalRouter::ProcessBridgedBroadcastLink(Ptr nd, // gets the IP interface address of the designated router in this // case. // - if (desigRtr == addrLocal) + if (designatedRtr == addrLocal) { c.Add (nd); NS_LOG_LOGIC ("Node " << node->GetId () << " elected a designated router"); } - plr->SetLinkId (desigRtr); + plr->SetLinkId (designatedRtr); // // OSPF says that the Link Data is this router's own IP address. @@ -1337,7 +1337,7 @@ GlobalRouter::FindDesignatedRouterForLink(Ptr ndLocal) const NS_LOG_LOGIC("Looking for designated router off of net device " << ndLocal << " on node " << ndLocal->GetNode()->GetId()); - Ipv4Address desigRtr("255.255.255.255"); + Ipv4Address designatedRtr("255.255.255.255"); // // Look through all of the devices on the channel to which the net device @@ -1402,8 +1402,8 @@ GlobalRouter::FindDesignatedRouterForLink(Ptr ndLocal) const "primary one"); } Ipv4Address addrOther = ipv4->GetAddress(interfaceOther, 0).GetLocal(); - desigRtr = addrOther < desigRtr ? addrOther : desigRtr; - NS_LOG_LOGIC("designated router now " << desigRtr); + designatedRtr = addrOther < designatedRtr ? addrOther : designatedRtr; + NS_LOG_LOGIC("designated router now " << designatedRtr); } } @@ -1433,8 +1433,8 @@ GlobalRouter::FindDesignatedRouterForLink(Ptr ndLocal) const NS_LOG_LOGIC("Recursively looking for routers down bridge port " << ndBridged); Ipv4Address addrOther = FindDesignatedRouterForLink(ndBridged); - desigRtr = addrOther < desigRtr ? addrOther : desigRtr; - NS_LOG_LOGIC("designated router now " << desigRtr); + designatedRtr = addrOther < designatedRtr ? addrOther : designatedRtr; + NS_LOG_LOGIC("designated router now " << designatedRtr); } } else @@ -1466,13 +1466,13 @@ GlobalRouter::FindDesignatedRouterForLink(Ptr ndLocal) const "primary one"); } Ipv4Address addrOther = ipv4->GetAddress(interfaceOther, 0).GetLocal(); - desigRtr = addrOther < desigRtr ? addrOther : desigRtr; - NS_LOG_LOGIC("designated router now " << desigRtr); + designatedRtr = addrOther < designatedRtr ? addrOther : designatedRtr; + NS_LOG_LOGIC("designated router now " << designatedRtr); } } } } - return desigRtr; + return designatedRtr; } // diff --git a/src/internet/model/ipv6-header.h b/src/internet/model/ipv6-header.h index 1927e40df..073863a9b 100644 --- a/src/internet/model/ipv6-header.h +++ b/src/internet/model/ipv6-header.h @@ -88,7 +88,7 @@ class Ipv6Header : public Header IPV6_EXT_ROUTING = 43, IPV6_EXT_FRAGMENTATION = 44, IPV6_EXT_CONFIDENTIALITY = 50, - IPV6_EXT_AUTHENTIFICATION = 51, + IPV6_EXT_AUTHENTICATION = 51, IPV6_ICMPV6 = 58, IPV6_EXT_END = 59, IPV6_EXT_DESTINATION = 60, diff --git a/src/lr-wpan/examples/lr-wpan-per-plot.cc b/src/lr-wpan/examples/lr-wpan-per-plot.cc index a770816f3..38d1f55f8 100644 --- a/src/lr-wpan/examples/lr-wpan-per-plot.cc +++ b/src/lr-wpan/examples/lr-wpan-per-plot.cc @@ -86,7 +86,7 @@ main(int argc, char* argv[]) Gnuplot perplot = Gnuplot("802.15.4-per-vs-rxSignal.eps"); Gnuplot2dDataset perdatasetExperimental("Experimental"); - Gnuplot2dDataset perdatasetTheorical("Theoretical"); + Gnuplot2dDataset perdatasetTheoretical("Theoretical"); Ptr n0 = CreateObject(); Ptr n1 = CreateObject(); @@ -214,7 +214,7 @@ main(int argc, char* argv[]) sensThreshold = false; } - perdatasetTheorical.Add(j, perTheoretical); + perdatasetTheoretical.Add(j, perTheoretical); } std::cout << "_____________________________________________________________________________\n"; @@ -229,7 +229,7 @@ main(int argc, char* argv[]) << "Rx Sensitivity (Theo) = " << sensitivityTheo << " dBm"; perplot.AddDataset(perdatasetExperimental); - perplot.AddDataset(perdatasetTheorical); + perplot.AddDataset(perdatasetTheoretical); perplot.SetTitle(os.str()); perplot.SetTerminal("postscript eps color enh \"Times-BoldItalic\""); diff --git a/src/lr-wpan/model/lr-wpan-constants.h b/src/lr-wpan/model/lr-wpan-constants.h index 4241df33a..609b5dc35 100644 --- a/src/lr-wpan/model/lr-wpan-constants.h +++ b/src/lr-wpan/model/lr-wpan-constants.h @@ -119,7 +119,7 @@ constexpr uint32_t aMaxBeaconOverhead{75}; * The maximum size, in octets, of a beacon payload. * See IEEE 802.15.4-2011, section 6.4.1, Table 51. */ -constexpr uint32_t aMaxBeaconPayloadLenght{aMaxPhyPacketSize - aMaxBeaconOverhead}; +constexpr uint32_t aMaxBeaconPayloadLength{aMaxPhyPacketSize - aMaxBeaconOverhead}; /** @} */ diff --git a/src/lr-wpan/model/lr-wpan-fields.cc b/src/lr-wpan/model/lr-wpan-fields.cc index 955f8adef..59829e815 100644 --- a/src/lr-wpan/model/lr-wpan-fields.cc +++ b/src/lr-wpan/model/lr-wpan-fields.cc @@ -268,18 +268,18 @@ GtsFields::Serialize(Buffer::Iterator i) const if (m_gtsSpecDescCount > 0) { - uint8_t gtsDescStartAndLenght; + uint8_t gtsDescStartAndLength; i.WriteU8(GetGtsDirectionField()); for (int j = 0; j < m_gtsSpecDescCount; j++) { WriteTo(i, m_gtsList[j].m_gtsDescDevShortAddr); - gtsDescStartAndLenght = + gtsDescStartAndLength = (m_gtsList[j].m_gtsDescStartSlot & 0x0F) | // GTS descriptor bits 16-19 (m_gtsList[j].m_gtsDescLength & 0xF0); // GTS descriptor bits 20-23 - i.WriteU8(gtsDescStartAndLenght); + i.WriteU8(gtsDescStartAndLength); } } return i; @@ -296,14 +296,14 @@ GtsFields::Deserialize(Buffer::Iterator i) uint8_t gtsDirectionField = i.ReadU8(); SetGtsDirectionField(gtsDirectionField); - uint8_t gtsDescStartAndLenght; + uint8_t gtsDescStartAndLength; for (int j = 0; j < m_gtsSpecDescCount; j++) { ReadFrom(i, m_gtsList[j].m_gtsDescDevShortAddr); - gtsDescStartAndLenght = i.ReadU8(); - m_gtsList[j].m_gtsDescStartSlot = (gtsDescStartAndLenght) & (0x0F); - m_gtsList[j].m_gtsDescLength = (gtsDescStartAndLenght >> 4) & (0x0F); + gtsDescStartAndLength = i.ReadU8(); + m_gtsList[j].m_gtsDescStartSlot = (gtsDescStartAndLength) & (0x0F); + m_gtsList[j].m_gtsDescLength = (gtsDescStartAndLength >> 4) & (0x0F); } } return i; diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 8a330757b..79f8736ec 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -833,7 +833,7 @@ LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, PtrmacBeaconPayload->GetSize() > lrwpan::aMaxBeaconPayloadLenght) + if (attribute->macBeaconPayload->GetSize() > lrwpan::aMaxBeaconPayloadLength) { confirmParams.m_status = MLMESET_INVALID_PARAMETER; } diff --git a/src/lr-wpan/model/lr-wpan-net-device.h b/src/lr-wpan/model/lr-wpan-net-device.h index 7c6758ad5..5d7ff5891 100644 --- a/src/lr-wpan/model/lr-wpan-net-device.h +++ b/src/lr-wpan/model/lr-wpan-net-device.h @@ -250,7 +250,7 @@ class LrWpanNetDevice : public NetDevice * * \param panId The PanID * \param shortAddr The Short MAC address - * \return a Pseudo-Mac48Adress + * \return a Pseudo-Mac48Address */ Mac48Address BuildPseudoMacAddress(uint16_t panId, Mac16Address shortAddr) const; @@ -309,8 +309,8 @@ class LrWpanNetDevice : public NetDevice /** * How the pseudo MAC address is created. * - * According to \RFC{4944} the psudo-MAC is YYYY:0000:XXXX (with U/L bit set to local) - * According to \RFC{6282} the psudo-MAC is 0200:0000:XXXX + * According to \RFC{4944} the pseudo-MAC is YYYY:0000:XXXX (with U/L bit set to local) + * According to \RFC{6282} the pseudo-MAC is 0200:0000:XXXX */ PseudoMacAddressMode_e m_pseudoMacMode; }; diff --git a/src/lte/doc/source/lte-design.rst b/src/lte/doc/source/lte-design.rst index f363a18f1..f61022b93 100644 --- a/src/lte/doc/source/lte-design.rst +++ b/src/lte/doc/source/lte-design.rst @@ -685,7 +685,7 @@ The model can be disabled for working with a zero-losses channel by setting the Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false)); -.. _sec-control-channles-phy-error-model: +.. _sec-control-channels-phy-error-model: Control Channels PHY Error Model ++++++++++++++++++++++++++++++++ @@ -2266,13 +2266,13 @@ is less than a defined threshold Qout (default: -5dB), the frame cannot be decod (see``LteUePhy::RadioLinkFailureDetection``). The Qout threshold corresponds to 10% block error rate (BLER) of a hypothetical PDCCH transmission taking into account the PCFICH errors [R4-081920]_ (also refer to -:ref:`sec-control-channles-phy-error-model`). Once, the UE is unable to decode +:ref:`sec-control-channels-phy-error-model`). Once, the UE is unable to decode 20 consecutive frames, i.e., the Qout evaluation period (200ms) is reached, an out-of-sync indication is sent to the UE RRC layer (see ``LteUeRrc::DoNotifyOutOfSync``). Else, the counter for the unsuccessfuly decoded frames is reset to zero. At the LteUeRrc, when the number of consecutive out-of-sync indications matches with the value of N310 parameter, the T310 timer is started and LteUePhy is notified to start -measuring for in-sync indications (see ``LteUePhy::DoStartInSnycDetection``). We note +measuring for in-sync indications (see ``LteUePhy::DoStartInSyncDetection``). We note that, the UE RRC state is not changed till the expiration of T310 timer. If the resultant SINR values averaged over a downlink frame is greater than a defined threshold Qin (default: -3.8dB), the frame is considered to be successfully @@ -2468,7 +2468,7 @@ where: - :math:`F_{n-1}` is the old filtered measurement result, where :math:`F_0 = M_1` (i.e. the first measurement is not filtered); and - :math:`a = (\frac{1}{2})^{\frac{k}{4}}`, where :math:`k` is the configurable - `filterCoefficent` provided by the ``QuantityConfig``; + `filterCoefficient` provided by the ``QuantityConfig``; :math:`k = 4` is the default value, but can be configured by setting the `RsrpFilterCoefficient` and `RsrqFilterCoefficient` attributes in diff --git a/src/lte/helper/lte-helper.cc b/src/lte/helper/lte-helper.cc index c5397a26a..08337c317 100644 --- a/src/lte/helper/lte-helper.cc +++ b/src/lte/helper/lte-helper.cc @@ -939,7 +939,7 @@ LteHelper::InstallSingleUeDevice(Ptr n) // number of component carriers in UE RRC ccmUe->SetNumberOfComponentCarriers(m_noOfCcs); - // run intializeSap to create the proper number of MAC and PHY control sap provider/users + // run initializeSap to create the proper number of MAC and PHY control sap provider/users rrc->InitializeSap(); if (m_useIdealRrc) diff --git a/src/lte/model/epc-enb-application.h b/src/lte/model/epc-enb-application.h index d44c4f1d9..100c65f3c 100644 --- a/src/lte/model/epc-enb-application.h +++ b/src/lte/model/epc-enb-application.h @@ -150,7 +150,7 @@ class EpcEnbApplication : public Application struct EpsFlowId_t { uint16_t m_rnti; ///< RNTI - uint8_t m_bid; ///< Bid, the EPS Bearer IDentifier + uint8_t m_bid; ///< Bid, the EPS Bearer Identifier public: EpsFlowId_t(); @@ -237,7 +237,7 @@ class EpcEnbApplication : public Application * * \param packet t * \param rnti maps to enbUeS1Id - * \param bid the EPS Bearer IDentifier + * \param bid the EPS Bearer Identifier */ void SendToLteSocket(Ptr packet, uint16_t rnti, uint8_t bid); @@ -245,16 +245,16 @@ class EpcEnbApplication : public Application * Send a packet to the SGW via the S1-U interface * * \param packet packet to be sent - * \param teid the Tunnel Endpoint IDentifier + * \param teid the Tunnel Endpoint Identifier */ void SendToS1uSocket(Ptr packet, uint32_t teid); /** * internal method used for the actual setup of the S1 Bearer * - * \param teid the Tunnel Endpoint IDentifier + * \param teid the Tunnel Endpoint Identifier * \param rnti maps to enbUeS1Id - * \param bid the S1-U Bearer IDentifier + * \param bid the S1-U Bearer Identifier */ void SetupS1Bearer(uint32_t teid, uint16_t rnti, uint8_t bid); diff --git a/src/lte/model/epc-pgw-application.h b/src/lte/model/epc-pgw-application.h index 1ee2cd51e..1adab080a 100644 --- a/src/lte/model/epc-pgw-application.h +++ b/src/lte/model/epc-pgw-application.h @@ -123,7 +123,7 @@ class EpcPgwApplication : public Application * * \param packet packet to be sent * \param sgwS5uAddress the address of the SGW - * \param teid the Tunnel Endpoint IDentifier + * \param teid the Tunnel Endpoint Identifier */ void SendToS5uSocket(Ptr packet, Ipv4Address sgwS5uAddress, uint32_t teid); diff --git a/src/lte/model/epc-sgw-application.h b/src/lte/model/epc-sgw-application.h index a70af2084..d515d3a3b 100644 --- a/src/lte/model/epc-sgw-application.h +++ b/src/lte/model/epc-sgw-application.h @@ -144,7 +144,7 @@ class EpcSgwApplication : public Application * * \param packet packet to be sent * \param enbS1uAddress the address of the eNB - * \param teid the Tunnel Endpoint IDentifier + * \param teid the Tunnel Endpoint Identifier */ void SendToS1uSocket(Ptr packet, Ipv4Address enbS1uAddress, uint32_t teid); diff --git a/src/lte/model/ff-mac-common.h b/src/lte/model/ff-mac-common.h index e333bf60e..db49208d1 100644 --- a/src/lte/model/ff-mac-common.h +++ b/src/lte/model/ff-mac-common.h @@ -262,7 +262,7 @@ struct RlcPduListElement_s }; /** - * \brief See section 4.3.8 builDataListElement + * \brief See section 4.3.8 buildDataListElement * \struct BuildDataListElement_s */ struct BuildDataListElement_s diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc index 977493912..09de76e23 100644 --- a/src/lte/model/lte-enb-mac.cc +++ b/src/lte/model/lte-enb-mac.cc @@ -261,8 +261,8 @@ class EnbMacMemberLteEnbPhySapUser : public LteEnbPhySapUser void ReceiveLteControlMessage(Ptr msg) override; void ReceiveRachPreamble(uint32_t prachId) override; void UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi) override; - void UlInfoListElementHarqFeeback(UlInfoListElement_s params) override; - void DlInfoListElementHarqFeeback(DlInfoListElement_s params) override; + void UlInfoListElementHarqFeedback(UlInfoListElement_s params) override; + void DlInfoListElementHarqFeedback(DlInfoListElement_s params) override; private: LteEnbMac* m_mac; ///< the MAC @@ -304,15 +304,15 @@ EnbMacMemberLteEnbPhySapUser::UlCqiReport(FfMacSchedSapProvider::SchedUlCqiInfoR } void -EnbMacMemberLteEnbPhySapUser::UlInfoListElementHarqFeeback(UlInfoListElement_s params) +EnbMacMemberLteEnbPhySapUser::UlInfoListElementHarqFeedback(UlInfoListElement_s params) { - m_mac->DoUlInfoListElementHarqFeeback(params); + m_mac->DoUlInfoListElementHarqFeedback(params); } void -EnbMacMemberLteEnbPhySapUser::DlInfoListElementHarqFeeback(DlInfoListElement_s params) +EnbMacMemberLteEnbPhySapUser::DlInfoListElementHarqFeedback(DlInfoListElement_s params) { - m_mac->DoDlInfoListElementHarqFeeback(params); + m_mac->DoDlInfoListElementHarqFeedback(params); } // ////////////////////////////////////// @@ -563,7 +563,7 @@ LteEnbMac::DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo) FfMacSchedSapProvider::SchedDlTriggerReqParameters dlparams; dlparams.m_sfnSf = ((0x3FF & dlSchedFrameNo) << 4) | (0xF & dlSchedSubframeNo); - // Forward DL HARQ feebacks collected during last TTI + // Forward DL HARQ Feedbacks collected during last TTI if (!m_dlInfoListReceived.empty()) { dlparams.m_dlInfoList = m_dlInfoListReceived; @@ -617,7 +617,7 @@ LteEnbMac::DoSubframeIndication(uint32_t frameNo, uint32_t subframeNo) FfMacSchedSapProvider::SchedUlTriggerReqParameters ulparams; ulparams.m_sfnSf = ((0x3FF & ulSchedFrameNo) << 4) | (0xF & ulSchedSubframeNo); - // Forward DL HARQ feebacks collected during last TTI + // Forward DL HARQ Feedbacks collected during last TTI if (!m_ulInfoListReceived.empty()) { ulparams.m_ulInfoList = m_ulInfoListReceived; @@ -646,7 +646,7 @@ LteEnbMac::DoReceiveLteControlMessage(Ptr msg) { Ptr dlharq = DynamicCast(msg); - DoDlInfoListElementHarqFeeback(dlharq->GetDlHarqFeedback()); + DoDlInfoListElementHarqFeedback(dlharq->GetDlHarqFeedback()); } else { @@ -1296,14 +1296,14 @@ LteEnbMac::DoCschedCellConfigUpdateInd( } void -LteEnbMac::DoUlInfoListElementHarqFeeback(UlInfoListElement_s params) +LteEnbMac::DoUlInfoListElementHarqFeedback(UlInfoListElement_s params) { NS_LOG_FUNCTION(this); m_ulInfoListReceived.push_back(params); } void -LteEnbMac::DoDlInfoListElementHarqFeeback(DlInfoListElement_s params) +LteEnbMac::DoDlInfoListElementHarqFeedback(DlInfoListElement_s params) { NS_LOG_FUNCTION(this); // Update HARQ buffer diff --git a/src/lte/model/lte-enb-mac.h b/src/lte/model/lte-enb-mac.h index ba4d2d542..4dc3a2648 100644 --- a/src/lte/model/lte-enb-mac.h +++ b/src/lte/model/lte-enb-mac.h @@ -365,12 +365,12 @@ class LteEnbMac : public Object * \brief UL Info List ELements HARQ Feedback function * \param params UlInfoListElement_s */ - void DoUlInfoListElementHarqFeeback(UlInfoListElement_s params); + void DoUlInfoListElementHarqFeedback(UlInfoListElement_s params); /** * \brief DL Info List ELements HARQ Feedback function * \param params DlInfoListElement_s */ - void DoDlInfoListElementHarqFeeback(DlInfoListElement_s params); + void DoDlInfoListElementHarqFeedback(DlInfoListElement_s params); /// RNTI, LC ID, SAP of the RLC instance std::map> m_rlcAttached; diff --git a/src/lte/model/lte-enb-phy-sap.h b/src/lte/model/lte-enb-phy-sap.h index 57f9de632..e20519a4d 100644 --- a/src/lte/model/lte-enb-phy-sap.h +++ b/src/lte/model/lte-enb-phy-sap.h @@ -109,14 +109,14 @@ class LteEnbPhySapUser * * \param params */ - virtual void UlInfoListElementHarqFeeback(UlInfoListElement_s params) = 0; + virtual void UlInfoListElementHarqFeedback(UlInfoListElement_s params) = 0; /** * Notify the HARQ on the DL transmission status * * \param params */ - virtual void DlInfoListElementHarqFeeback(DlInfoListElement_s params) = 0; + virtual void DlInfoListElementHarqFeedback(DlInfoListElement_s params) = 0; }; } // namespace ns3 diff --git a/src/lte/model/lte-enb-phy.cc b/src/lte/model/lte-enb-phy.cc index f25134526..22812abf3 100644 --- a/src/lte/model/lte-enb-phy.cc +++ b/src/lte/model/lte-enb-phy.cc @@ -1161,7 +1161,7 @@ LteEnbPhy::ReportUlHarqFeedback(UlInfoListElement_s mes) { NS_LOG_FUNCTION(this); // forward to scheduler - m_enbPhySapUser->UlInfoListElementHarqFeeback(mes); + m_enbPhySapUser->UlInfoListElementHarqFeedback(mes); } } // namespace ns3 diff --git a/src/lte/model/lte-fr-strict-algorithm.h b/src/lte/model/lte-fr-strict-algorithm.h index 2b7bc91ee..6d13f99bc 100644 --- a/src/lte/model/lte-fr-strict-algorithm.h +++ b/src/lte/model/lte-fr-strict-algorithm.h @@ -141,7 +141,7 @@ class LteFrStrictAlgorithm : public LteFfrAlgorithm }; std::map m_ues; ///< UEs - std::vector m_egdeUes; ///< Edge UEs + std::vector m_edgeUes; ///< Edge UEs uint8_t m_edgeSubBandThreshold; ///< Edge subband threshold diff --git a/src/lte/model/lte-rlc-am-header.h b/src/lte/model/lte-rlc-am-header.h index 22fbb674d..948b79254 100644 --- a/src/lte/model/lte-rlc-am-header.h +++ b/src/lte/model/lte-rlc-am-header.h @@ -74,7 +74,7 @@ class LteRlcAmHeader : public Header }; /// ControlPduType_t enumeration - enum ControPduType_t + enum ControlPduType_t { STATUS_PDU = 000, }; diff --git a/src/lte/model/lte-rrc-header.cc b/src/lte/model/lte-rrc-header.cc index 5319bb473..2cf040a12 100644 --- a/src/lte/model/lte-rrc-header.cc +++ b/src/lte/model/lte-rrc-header.cc @@ -1934,7 +1934,7 @@ RrcAsn1Header::SerializeRadioResourceConfigCommonSCell( SerializeInteger(rrccsc.ulConfiguration.ulFreqInfo.ulCarrierFreq, 0, MAX_EARFCN); SerializeInteger(rrccsc.ulConfiguration.ulFreqInfo.ulBandwidth, 6, 100); - // Serialize UlPowerControllCommonSCell + // Serialize UlPowerControlCommonSCell std::bitset<2> UlPowerControlCommonSCell_r10; UlPowerControlCommonSCell_r10.set(1, 0); // p0-NominalPUSCH-r10 Not Implemented UlPowerControlCommonSCell_r10.set(0, 1); // alpha @@ -5384,7 +5384,7 @@ RrcConnectionReconfigurationHeader::PreSerialize() const // Serialize t304 SerializeEnum(8, 0); - // Serialize newUE-Identitiy + // Serialize newUE-Identity SerializeBitstring(std::bitset<16>(m_mobilityControlInfo.newUeIdentity)); // Serialize radioResourceConfigCommon @@ -6258,7 +6258,7 @@ RrcConnectionReestablishmentRequestHeader::PreSerialize() const SerializeUlCcchMessage(0); - // Serialize RrcConnectionReestablishmentReques sequence: + // Serialize RrcConnectionReestablishmentRequest sequence: // no default or optional fields. Extension marker not present. SerializeSequence(std::bitset<0>(), false); diff --git a/src/lte/model/lte-ue-cphy-sap.h b/src/lte/model/lte-ue-cphy-sap.h index c8af203ce..3b2e573b4 100644 --- a/src/lte/model/lte-ue-cphy-sap.h +++ b/src/lte/model/lte-ue-cphy-sap.h @@ -194,7 +194,7 @@ class LteUeCphySapProvider * started by checking if the radio frames are in-sync for N311 * consecutive times. */ - virtual void StartInSnycDetection() = 0; + virtual void StartInSyncDetection() = 0; /** * \brief A method call by UE RRC to communicate the IMSI to the UE PHY @@ -327,7 +327,7 @@ class MemberLteUeCphySapProvider : public LteUeCphySapProvider void SetRsrpFilterCoefficient(uint8_t rsrpFilterCoefficient) override; void ResetPhyAfterRlf() override; void ResetRlfParams() override; - void StartInSnycDetection() override; + void StartInSyncDetection() override; void SetImsi(uint64_t imsi) override; private: @@ -454,9 +454,9 @@ MemberLteUeCphySapProvider::ResetRlfParams() template void -MemberLteUeCphySapProvider::StartInSnycDetection() +MemberLteUeCphySapProvider::StartInSyncDetection() { - m_owner->DoStartInSnycDetection(); + m_owner->DoStartInSyncDetection(); } template diff --git a/src/lte/model/lte-ue-phy.cc b/src/lte/model/lte-ue-phy.cc index f7cf3591e..4c0eb4e46 100644 --- a/src/lte/model/lte-ue-phy.cc +++ b/src/lte/model/lte-ue-phy.cc @@ -1585,7 +1585,7 @@ LteUePhy::DoResetRlfParams() } void -LteUePhy::DoStartInSnycDetection() +LteUePhy::DoStartInSyncDetection() { NS_LOG_FUNCTION(this); // indicates that the downlink radio link quality has to be monitored for in-sync indications @@ -1617,7 +1617,7 @@ LteUePhy::RlfDetection(double sinrDb) m_numOfSubframes++; NS_LOG_LOGIC("No of Subframes: " << m_numOfSubframes << " UE synchronized: " << m_downlinkInSync); - // check for out_of_snyc indications first when UE is both DL and UL synchronized + // check for out_of_sync indications first when UE is both DL and UL synchronized // m_downlinkInSync=true indicates that the evaluation is for out-of-sync indications if (m_downlinkInSync && m_numOfSubframes == 10) { @@ -1657,7 +1657,7 @@ LteUePhy::RlfDetection(double sinrDb) m_ueCphySapUser->NotifyOutOfSync(); m_numOfFrames = 0; } - // check for in_snyc indications when T310 timer is started + // check for in_sync indications when T310 timer is started // m_downlinkInSync=false indicates that the evaluation is for in-sync indications if (!m_downlinkInSync && m_numOfSubframes == 10) { diff --git a/src/lte/model/lte-ue-phy.h b/src/lte/model/lte-ue-phy.h index 38d25c552..575fe1300 100644 --- a/src/lte/model/lte-ue-phy.h +++ b/src/lte/model/lte-ue-phy.h @@ -580,7 +580,7 @@ class LteUePhy : public LtePhy * consecutive times. * */ - void DoStartInSnycDetection(); + void DoStartInSyncDetection(); /** * \brief Radio link failure detection function diff --git a/src/lte/model/lte-ue-rrc.cc b/src/lte/model/lte-ue-rrc.cc index 821d0d5ea..8b8fd7e88 100644 --- a/src/lte/model/lte-ue-rrc.cc +++ b/src/lte/model/lte-ue-rrc.cc @@ -3374,7 +3374,7 @@ LteUeRrc::DoNotifyOutOfSync() { NS_LOG_INFO("t310 started"); } - m_cphySapProvider.at(0)->StartInSnycDetection(); + m_cphySapProvider.at(0)->StartInSyncDetection(); m_noOfSyncIndications = 0; } } diff --git a/src/lte/model/lte-ue-rrc.h b/src/lte/model/lte-ue-rrc.h index daf4ef1f3..9b8c1d542 100644 --- a/src/lte/model/lte-ue-rrc.h +++ b/src/lte/model/lte-ue-rrc.h @@ -347,7 +347,7 @@ class LteUeRrc : public Object typedef void (*ImsiCidRntiTracedCallback)(uint64_t imsi, uint16_t cellId, uint16_t rnti); /** - * TracedCallback signature for MIBRecieved, Sib1Received and + * TracedCallback signature for MIBReceived, Sib1Received and * HandoverStart events. * * \param [in] imsi diff --git a/src/lte/model/rr-ff-mac-scheduler.cc b/src/lte/model/rr-ff-mac-scheduler.cc index 5bf71eb6a..b1b9332de 100644 --- a/src/lte/model/rr-ff-mac-scheduler.cc +++ b/src/lte/model/rr-ff-mac-scheduler.cc @@ -978,10 +978,10 @@ RrFfMacScheduler::DoSchedDlTriggerReq( if ((itLcRnti == lcActivesPerRnti.end()) || (itRnti != rntiAllocated.end())) { // skip this RNTI (no active queue or yet allocated for HARQ) - uint16_t rntiDiscared = (*it).m_rnti; + uint16_t rntiDiscarded = (*it).m_rnti; while (it != m_rlcBufferReq.end()) { - if ((*it).m_rnti != rntiDiscared) + if ((*it).m_rnti != rntiDiscarded) { break; } diff --git a/src/lte/test/lte-test-ipv6-routing.cc b/src/lte/test/lte-test-ipv6-routing.cc index f6ab82189..c09559566 100644 --- a/src/lte/test/lte-test-ipv6-routing.cc +++ b/src/lte/test/lte-test-ipv6-routing.cc @@ -181,7 +181,7 @@ LteIpv6RoutingTestCase::Checker() Ptr p2 = (*it2)->Copy(); Ipv6Header ipv6header2; p2->RemoveHeader(ipv6header2); - Ipv6Address sorceAddress = ipv6header2.GetSource(); + Ipv6Address sourceAddress = ipv6header2.GetSource(); Ipv6Address destinationAddress = ipv6header2.GetDestination(); UdpHeader udpHeader2; p2->RemoveHeader(udpHeader2); @@ -190,7 +190,7 @@ LteIpv6RoutingTestCase::Checker() sourcePort = udpHeader2.GetSourcePort(); destinationPort = udpHeader2.GetDestinationPort(); // Check whether the uids, addresses and ports match - if ((p2->GetUid() == p1->GetUid()) && sorceAddress == ipv6header1.GetDestination() && + if ((p2->GetUid() == p1->GetUid()) && sourceAddress == ipv6header1.GetDestination() && destinationAddress == ipv6header1.GetSource() && sourcePort == udpHeader1.GetDestinationPort() && destinationPort == udpHeader1.GetSourcePort()) diff --git a/src/lte/test/test-lte-handover-failure.cc b/src/lte/test/test-lte-handover-failure.cc index 96255ce9b..5181a121b 100644 --- a/src/lte/test/test-lte-handover-failure.cc +++ b/src/lte/test/test-lte-handover-failure.cc @@ -110,7 +110,7 @@ class LteHandoverFailureTestCase : public TestCase m_handoverJoiningTimeout(handoverJoiningTimeout), m_handoverLeavingTimeout(handoverLeavingTimeout), m_targeteNodeBPosition(targeteNodeBPosition), - m_hasHandoverFailureOccured(false) + m_hasHandoverFailureOccurred(false) { } @@ -198,8 +198,8 @@ class LteHandoverFailureTestCase : public TestCase uint8_t m_raResponseWindowSize; ///< window length for reception of RAR Time m_handoverJoiningTimeout; ///< handover joining timeout duration at target eNodeB Time m_handoverLeavingTimeout; ///< handover leaving timeout duration at source eNodeB - uint16_t m_targeteNodeBPosition; ///< position of the target eNodeB - bool m_hasHandoverFailureOccured; ///< has handover failure occurred in simulation + uint16_t m_targeteNodeBPosition; ///< position of the target eNodeB + bool m_hasHandoverFailureOccurred; ///< has handover failure occurred in simulation }; // end of class LteHandoverFailureTestCase @@ -321,7 +321,7 @@ LteHandoverFailureTestCase::HandoverFailureMaxRach(std::string context, uint16_t targetCellId) { NS_LOG_FUNCTION(this << context << imsi << rnti << targetCellId); - m_hasHandoverFailureOccured = true; + m_hasHandoverFailureOccurred = true; } void @@ -331,7 +331,7 @@ LteHandoverFailureTestCase::HandoverFailureNoPreamble(std::string context, uint16_t targetCellId) { NS_LOG_FUNCTION(this << context << imsi << rnti << targetCellId); - m_hasHandoverFailureOccured = true; + m_hasHandoverFailureOccurred = true; } void @@ -341,7 +341,7 @@ LteHandoverFailureTestCase::HandoverFailureJoining(std::string context, uint16_t targetCellId) { NS_LOG_FUNCTION(this << context << imsi << rnti << targetCellId); - m_hasHandoverFailureOccured = true; + m_hasHandoverFailureOccurred = true; } void @@ -351,14 +351,14 @@ LteHandoverFailureTestCase::HandoverFailureLeaving(std::string context, uint16_t targetCellId) { NS_LOG_FUNCTION(this << context << imsi << rnti << targetCellId); - m_hasHandoverFailureOccured = true; + m_hasHandoverFailureOccurred = true; } void LteHandoverFailureTestCase::DoTeardown() { NS_LOG_FUNCTION(this); - NS_TEST_ASSERT_MSG_EQ(m_hasHandoverFailureOccured, true, "Handover failure did not occur"); + NS_TEST_ASSERT_MSG_EQ(m_hasHandoverFailureOccurred, true, "Handover failure did not occur"); } /** diff --git a/src/lte/test/test-lte-x2-handover.cc b/src/lte/test/test-lte-x2-handover.cc index 8358d3082..214bdd616 100644 --- a/src/lte/test/test-lte-x2-handover.cc +++ b/src/lte/test/test-lte-x2-handover.cc @@ -708,48 +708,48 @@ LteX2HandoverTestSuite::LteX2HandoverTestSuite() ue2bwd.sourceEnbDeviceIndex = 1; ue2bwd.targetEnbDeviceIndex = 0; - std::string hel0name("none"); - std::list hel0; + std::string handoverEventList0name("none"); + std::list handoverEventList0; - std::string hel1name("1 fwd"); - const std::list hel1{ + std::string handoverEventList1name("1 fwd"); + const std::list handoverEventList1{ ue1fwd, }; - std::string hel2name("1 fwd & bwd"); - const std::list hel2{ + std::string handoverEventList2name("1 fwd & bwd"); + const std::list handoverEventList2{ ue1fwd, ue1bwd, }; - std::string hel3name("1 fwd & bwd & fwd"); - const std::list hel3{ + std::string handoverEventList3name("1 fwd & bwd & fwd"); + const std::list handoverEventList3{ ue1fwd, ue1bwd, ue1fwdagain, }; - std::string hel4name("1+2 fwd"); - const std::list hel4{ + std::string handoverEventList4name("1+2 fwd"); + const std::list handoverEventList4{ ue1fwd, ue2fwd, }; - std::string hel5name("1+2 fwd & bwd"); - const std::list hel5{ + std::string handoverEventList5name("1+2 fwd & bwd"); + const std::list handoverEventList5{ ue1fwd, ue1bwd, ue2fwd, ue2bwd, }; - // std::string hel6name("2 fwd"); - // const std::list hel6{ + // std::string handoverEventList6name("2 fwd"); + // const std::list handoverEventList6{ // ue2fwd, // }; - // std::string hel7name("2 fwd & bwd"); - // const std::list hel7{ + // std::string handoverEventList7name("2 fwd & bwd"); + // const std::list handoverEventList7{ // ue2fwd, // ue2bwd, // }; @@ -766,126 +766,326 @@ LteX2HandoverTestSuite::LteX2HandoverTestSuite() for (int32_t useIdealRrc = 1; useIdealRrc >= 0; --useIdealRrc) { // nUes, nDBearers, helist, name, sched, admitHo, idealRrc - AddTestCase( - new LteX2HandoverTestCase(1, 0, hel0, hel0name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel0, hel0name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 5, hel0, hel0name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 5, hel0, hel0name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 0, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 1, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 2, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 0, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 1, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 2, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 1, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 2, hel1, hel1name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 1, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 2, hel1, hel1name, *schedIt, false, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 0, hel2, hel2name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 1, hel2, hel2name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 2, hel2, hel2name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 0, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 1, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(1, 2, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 1, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 2, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::QUICK); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 1, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 2, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 0, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 1, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(2, 2, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 0, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 1, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 2, hel3, hel3name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 0, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 1, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 2, hel4, hel4name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 0, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 1, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::EXTENSIVE); - AddTestCase( - new LteX2HandoverTestCase(3, 2, hel5, hel5name, *schedIt, true, useIdealRrc), - TestCase::QUICK); + AddTestCase(new LteX2HandoverTestCase(1, + 0, + handoverEventList0, + handoverEventList0name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList0, + handoverEventList0name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 5, + handoverEventList0, + handoverEventList0name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 5, + handoverEventList0, + handoverEventList0name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 0, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 1, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 2, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 0, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 1, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 2, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 1, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 2, + handoverEventList1, + handoverEventList1name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 1, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 2, + handoverEventList1, + handoverEventList1name, + *schedIt, + false, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 0, + handoverEventList2, + handoverEventList2name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 1, + handoverEventList2, + handoverEventList2name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 2, + handoverEventList2, + handoverEventList2name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 0, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 1, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(1, + 2, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 1, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 2, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::QUICK); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 1, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 2, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 0, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 1, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(2, + 2, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 0, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 1, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 2, + handoverEventList3, + handoverEventList3name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 0, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 1, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 2, + handoverEventList4, + handoverEventList4name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 0, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 1, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::EXTENSIVE); + AddTestCase(new LteX2HandoverTestCase(3, + 2, + handoverEventList5, + handoverEventList5name, + *schedIt, + true, + useIdealRrc), + TestCase::QUICK); } } } diff --git a/src/mesh/model/dot11s/hwmp-protocol.h b/src/mesh/model/dot11s/hwmp-protocol.h index 3b53c51cf..6b4a6992b 100644 --- a/src/mesh/model/dot11s/hwmp-protocol.h +++ b/src/mesh/model/dot11s/hwmp-protocol.h @@ -136,12 +136,12 @@ class HwmpProtocol : public MeshL2RoutingProtocol bool Install(Ptr mp); /** * Peer link status function - * \param meshPontAddress The MAC address of the mesh point + * \param meshPointAddress The MAC address of the mesh point * \param peerAddress The MAC address of the peer * \param interface The interface number * \param status The status of the peer link */ - void PeerLinkStatus(Mac48Address meshPontAddress, + void PeerLinkStatus(Mac48Address meshPointAddress, Mac48Address peerAddress, uint32_t interface, bool status); diff --git a/src/mesh/model/dot11s/peer-management-protocol-mac.h b/src/mesh/model/dot11s/peer-management-protocol-mac.h index f063f00a7..6200e91c6 100644 --- a/src/mesh/model/dot11s/peer-management-protocol-mac.h +++ b/src/mesh/model/dot11s/peer-management-protocol-mac.h @@ -186,7 +186,7 @@ class PeerManagementProtocolMac : public MeshWifiInterfaceMacPlugin * Set peer manager protocol function * \param protocol the peer manager protocol */ - void SetPeerManagerProtcol(Ptr protocol); + void SetPeerManagerProtocol(Ptr protocol); /** * Send peer link management frame function * \param peerAddress the peer MAC address diff --git a/src/mesh/model/dot11s/peer-management-protocol.h b/src/mesh/model/dot11s/peer-management-protocol.h index 53d18e29e..1c5f44219 100644 --- a/src/mesh/model/dot11s/peer-management-protocol.h +++ b/src/mesh/model/dot11s/peer-management-protocol.h @@ -300,13 +300,13 @@ class PeerManagementProtocol : public Object * \brief Indicates changes in peer links * \param interface the interface * \param peerAddress the peer address - * \param peerMeshPointAddres the peer mesh point address + * \param peerMeshPointAddress the peer mesh point address * \param ostate old state * \param nstate new state */ void PeerLinkStatus(uint32_t interface, Mac48Address peerAddress, - Mac48Address peerMeshPointAddres, + Mac48Address peerMeshPointAddress, PeerLink::PeerState ostate, PeerLink::PeerState nstate); /** diff --git a/src/mobility/examples/reference-point-group-mobility-example.cc b/src/mobility/examples/reference-point-group-mobility-example.cc index 1a9083908..f65f231f6 100644 --- a/src/mobility/examples/reference-point-group-mobility-example.cc +++ b/src/mobility/examples/reference-point-group-mobility-example.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Michele Polese - * Heavily edited by Tom Henderson (to reuse HierachicalMobilityModel) + * Heavily edited by Tom Henderson (to reuse HierarchicalMobilityModel) */ /** @@ -140,7 +140,7 @@ main(int argc, char* argv[]) waypointMm->AddWaypoint(Waypoint(Seconds(700), Vector(90, 10, 0))); waypointMm->AddWaypoint(Waypoint(Seconds(800), Vector(10, 10, 0))); - // Each HierachicalMobilityModel contains the above model as the Parent, + // Each HierarchicalMobilityModel contains the above model as the Parent, // and a user defined model as the Child. Two MobilityModel objects are // instantiated per node (one hierarchical, and one child model), and // a single parent model is reused across all nodes. diff --git a/src/mpi/model/mpi-receiver.h b/src/mpi/model/mpi-receiver.h index 2ca2babd9..13b27204e 100644 --- a/src/mpi/model/mpi-receiver.h +++ b/src/mpi/model/mpi-receiver.h @@ -18,7 +18,7 @@ /** * \file * \ingroup mpi - * ns3::MpiReciver declaration, + * ns3::MpiReceiver declaration, * provides an interface to aggregate to MPI-compatible NetDevices. */ diff --git a/src/mpi/model/null-message-simulator-impl.h b/src/mpi/model/null-message-simulator-impl.h index e4c38c336..851caacf7 100644 --- a/src/mpi/model/null-message-simulator-impl.h +++ b/src/mpi/model/null-message-simulator-impl.h @@ -148,14 +148,14 @@ class NullMessageSimulatorImpl : public SimulatorImpl * \param bundle Bundle to reschedule Null Message event for * * Reschedule Null Message event for the specified - * RemoteChannelBundel. Existing event will be canceled. + * RemoteChannelBundle. Existing event will be canceled. */ void RescheduleNullMessageEvent(Ptr bundle); /** * \param nodeSysId SystemID to reschedule null event for * - * Reschedule Null Message event for the RemoteChannelBundel to the + * Reschedule Null Message event for the RemoteChannelBundle to the * task nodeSysId. Existing event will be canceled. */ void RescheduleNullMessageEvent(uint32_t nodeSysId); @@ -165,7 +165,7 @@ class NullMessageSimulatorImpl : public SimulatorImpl * * \return Guarantee time * - * Calculate the guarantee time for incoming RemoteChannelBundel + * Calculate the guarantee time for incoming RemoteChannelBundle * from task nodeSysId. No message should arrive from task * nodeSysId with a receive time less than the guarantee time. */ diff --git a/src/network/examples/CMakeLists.txt b/src/network/examples/CMakeLists.txt index 7fdcc43ba..28220767b 100644 --- a/src/network/examples/CMakeLists.txt +++ b/src/network/examples/CMakeLists.txt @@ -3,7 +3,7 @@ set(base_examples main-packet-header main-packet-tag packet-socket-apps - lollipop-comparisions + lollipop-comparisons ) foreach( diff --git a/src/network/examples/lollipop-comparisions.cc b/src/network/examples/lollipop-comparisons.cc similarity index 100% rename from src/network/examples/lollipop-comparisions.cc rename to src/network/examples/lollipop-comparisons.cc diff --git a/src/network/model/nix-vector.cc b/src/network/model/nix-vector.cc index d7caeb3cc..ad4adbd86 100644 --- a/src/network/model/nix-vector.cc +++ b/src/network/model/nix-vector.cc @@ -257,13 +257,13 @@ NixVector::Deserialize(const uint32_t* buffer, uint32_t size) m_used = *p++; // NixVector is packed in 32-bit unsigned ints. - uint32_t nixVectorLenth = m_totalBitSize / 32; - nixVectorLenth += (m_totalBitSize % 32) ? 1 : 0; + uint32_t nixVectorLength = m_totalBitSize / 32; + nixVectorLength += (m_totalBitSize % 32) ? 1 : 0; - NS_ASSERT_MSG(size >= 16 + nixVectorLenth, - "NixVector serialized length should have been " << 16 + nixVectorLenth + NS_ASSERT_MSG(size >= 16 + nixVectorLength, + "NixVector serialized length should have been " << 16 + nixVectorLength << " but buffer is shorter"); - if (size < 16 + nixVectorLenth * 4) + if (size < 16 + nixVectorLength * 4) { // return zero if an entire nix-vector was // not deserialized @@ -273,7 +273,7 @@ NixVector::Deserialize(const uint32_t* buffer, uint32_t size) // make sure the nix-vector // is empty m_nixVector.clear(); - for (uint32_t j = 0; j < nixVectorLenth; j++) + for (uint32_t j = 0; j < nixVectorLength; j++) { uint32_t nix = *p++; m_nixVector.push_back(nix); diff --git a/src/network/model/packet-metadata.cc b/src/network/model/packet-metadata.cc index dd3c9b173..331c25353 100644 --- a/src/network/model/packet-metadata.cc +++ b/src/network/model/packet-metadata.cc @@ -1083,8 +1083,8 @@ PacketMetadata::ItemIterator::Next() m_current = smallItem.next; uint32_t uid = (smallItem.typeUid & 0xfffffffe) >> 1; item.tid.SetUid(uid); - item.currentTrimedFromStart = extraItem.fragmentStart; - item.currentTrimedFromEnd = extraItem.fragmentEnd - smallItem.size; + item.currentTrimmedFromStart = extraItem.fragmentStart; + item.currentTrimmedFromEnd = extraItem.fragmentEnd - smallItem.size; item.currentSize = extraItem.fragmentEnd - extraItem.fragmentStart; if (extraItem.fragmentStart != 0 || extraItem.fragmentEnd != smallItem.size) { diff --git a/src/network/model/packet-metadata.h b/src/network/model/packet-metadata.h index 1a3fa863f..51ad2efbb 100644 --- a/src/network/model/packet-metadata.h +++ b/src/network/model/packet-metadata.h @@ -117,12 +117,12 @@ class PacketMetadata * how many bytes were trimmed from the start of a fragment. * if isFragment is true, this field is zero. */ - uint32_t currentTrimedFromStart; + uint32_t currentTrimmedFromStart; /** * how many bytes were trimmed from the end of a fragment. * if isFragment is true, this field is zero. */ - uint32_t currentTrimedFromEnd; + uint32_t currentTrimmedFromEnd; /** * an iterator which can be fed to Deserialize. Valid only * if isFragment and isPayload are false. diff --git a/src/network/model/packet.cc b/src/network/model/packet.cc index 82503adef..e62ca11a7 100644 --- a/src/network/model/packet.cc +++ b/src/network/model/packet.cc @@ -471,8 +471,8 @@ Packet::Print(std::ostream& os) const os << item.tid.GetName(); break; } - os << " Fragment [" << item.currentTrimedFromStart << ":" - << (item.currentTrimedFromStart + item.currentSize) << "]"; + os << " Fragment [" << item.currentTrimmedFromStart << ":" + << (item.currentTrimmedFromStart + item.currentSize) << "]"; } else { @@ -540,8 +540,8 @@ Packet::Print(std::ostream& os) const os << item.tid.GetName (); break; } - os << " Fragment [" << item.currentTrimedFromStart<<":" - << (item.currentTrimedFromStart + item.currentSize) << "]"; + os << " Fragment [" << item.currentTrimmedFromStart<<":" + << (item.currentTrimmedFromStart + item.currentSize) << "]"; } else { diff --git a/src/point-to-point-layout/doc/point-to-point-dumbbell.rst b/src/point-to-point-layout/doc/point-to-point-dumbbell.rst index 8549d5f00..b6c952059 100644 --- a/src/point-to-point-layout/doc/point-to-point-dumbbell.rst +++ b/src/point-to-point-layout/doc/point-to-point-dumbbell.rst @@ -38,7 +38,7 @@ nodes, function ``AssignIpv4Addresses`` which takes ``Ipv4AddressHelper`` objects for the left, right and router nodes for assigning IPv4 address to each node. It provides a function ``AssignIpv6Addresses`` which takes a ``Ipv6Address`` address base and a ``Ipv6Prefix`` prefix for assigning -IPv6Adddress to every node. +IPv6Address to every node. Node Positioning ================ diff --git a/src/propagation/model/jakes-process.cc b/src/propagation/model/jakes-process.cc index 34fa21133..83d7bd4f5 100644 --- a/src/propagation/model/jakes-process.cc +++ b/src/propagation/model/jakes-process.cc @@ -143,12 +143,12 @@ JakesProcess::DoDispose() std::complex JakesProcess::GetComplexGain() const { - std::complex sumAplitude = std::complex(0, 0); + std::complex sumAmplitude = std::complex(0, 0); for (unsigned int i = 0; i < m_oscillators.size(); i++) { - sumAplitude += m_oscillators[i].GetValueAt(Now()); + sumAmplitude += m_oscillators[i].GetValueAt(Now()); } - return sumAplitude; + return sumAmplitude; } double diff --git a/src/sixlowpan/doc/sixlowpan.rst b/src/sixlowpan/doc/sixlowpan.rst index 17858987c..09336e94f 100644 --- a/src/sixlowpan/doc/sixlowpan.rst +++ b/src/sixlowpan/doc/sixlowpan.rst @@ -112,8 +112,8 @@ attribute. Scope and Limitations ===================== -Contex-based compression -######################## +Context-based compression +######################### IPHC sateful (context-based) compression is supported but, since :rfc:`6775` ("Neighbor Discovery Optimization for IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs)") diff --git a/src/sixlowpan/model/sixlowpan-net-device.cc b/src/sixlowpan/model/sixlowpan-net-device.cc index 24adaee63..333002b4a 100644 --- a/src/sixlowpan/model/sixlowpan-net-device.cc +++ b/src/sixlowpan/model/sixlowpan-net-device.cc @@ -1427,8 +1427,8 @@ SixLowPanNetDevice::DecompressLowPanIphc(Ptr packet, const Address& src, return true; } - uint8_t contexPrefix[16]; - m_contextTable[contextId].contextPrefix.GetBytes(contexPrefix); + uint8_t contextPrefix[16]; + m_contextTable[contextId].contextPrefix.GetBytes(contextPrefix); uint8_t contextLength = m_contextTable[contextId].contextPrefix.GetPrefixLength(); uint8_t srcAddress[16] = {}; @@ -1453,13 +1453,13 @@ SixLowPanNetDevice::DecompressLowPanIphc(Ptr packet, const Address& src, // Do not combine the prefix - we want to override the bytes. for (uint8_t i = 0; i < bytesToCopy; i++) { - srcAddress[i] = contexPrefix[i]; + srcAddress[i] = contextPrefix[i]; } if (bitsToCopy) { uint8_t addressBitMask = (1 << (8 - bitsToCopy)) - 1; uint8_t prefixBitMask = ~addressBitMask; - srcAddress[bytesToCopy] = (contexPrefix[bytesToCopy] & prefixBitMask) | + srcAddress[bytesToCopy] = (contextPrefix[bytesToCopy] & prefixBitMask) | (srcAddress[bytesToCopy] & addressBitMask); } ipHeader.SetSource(Ipv6Address::Deserialize(srcAddress)); @@ -1524,8 +1524,8 @@ SixLowPanNetDevice::DecompressLowPanIphc(Ptr packet, const Address& src, return true; } - uint8_t contexPrefix[16]; - m_contextTable[contextId].contextPrefix.GetBytes(contexPrefix); + uint8_t contextPrefix[16]; + m_contextTable[contextId].contextPrefix.GetBytes(contextPrefix); uint8_t contextLength = m_contextTable[contextId].contextPrefix.GetPrefixLength(); if (encoding.GetM() == false) @@ -1553,13 +1553,13 @@ SixLowPanNetDevice::DecompressLowPanIphc(Ptr packet, const Address& src, // Do not combine the prefix - we want to override the bytes. for (uint8_t i = 0; i < bytesToCopy; i++) { - dstAddress[i] = contexPrefix[i]; + dstAddress[i] = contextPrefix[i]; } if (bitsToCopy) { uint8_t addressBitMask = (1 << (8 - bitsToCopy)) - 1; uint8_t prefixBitMask = ~addressBitMask; - dstAddress[bytesToCopy] = (contexPrefix[bytesToCopy] & prefixBitMask) | + dstAddress[bytesToCopy] = (contextPrefix[bytesToCopy] & prefixBitMask) | (dstAddress[bytesToCopy] & addressBitMask); } ipHeader.SetDestination(Ipv6Address::Deserialize(dstAddress)); @@ -1572,7 +1572,7 @@ SixLowPanNetDevice::DecompressLowPanIphc(Ptr packet, const Address& src, dstAddress[0] = 0xff; memcpy(dstAddress + 1, encoding.GetDstInlinePart(), 2); dstAddress[3] = contextLength; - memcpy(dstAddress + 4, contexPrefix, 8); + memcpy(dstAddress + 4, contextPrefix, 8); memcpy(dstAddress + 12, encoding.GetDstInlinePart() + 2, 4); ipHeader.SetDestination(Ipv6Address::Deserialize(dstAddress)); } @@ -2485,7 +2485,7 @@ SixLowPanNetDevice::ProcessFragment(Ptr& packet, FragmentsTimeoutsListI_t iter = m_timeoutEventList.begin(); FragmentKey_t oldestKey = std::get<1>(*iter); - std::list> storedFragments = m_fragments[oldestKey]->GetFraments(); + std::list> storedFragments = m_fragments[oldestKey]->GetFragments(); for (std::list>::iterator fragIter = storedFragments.begin(); fragIter != storedFragments.end(); fragIter++) @@ -2658,7 +2658,7 @@ SixLowPanNetDevice::Fragments::SetPacketSize(uint32_t packetSize) } std::list> -SixLowPanNetDevice::Fragments::GetFraments() const +SixLowPanNetDevice::Fragments::GetFragments() const { std::list> fragments; std::list, uint16_t>>::const_iterator iter; @@ -2687,7 +2687,7 @@ SixLowPanNetDevice::HandleFragmentsTimeout(FragmentKey_t key, uint32_t iif) NS_LOG_FUNCTION(this); MapFragments_t::iterator it = m_fragments.find(key); - std::list> storedFragments = it->second->GetFraments(); + std::list> storedFragments = it->second->GetFragments(); for (std::list>::iterator fragIter = storedFragments.begin(); fragIter != storedFragments.end(); fragIter++) diff --git a/src/sixlowpan/model/sixlowpan-net-device.h b/src/sixlowpan/model/sixlowpan-net-device.h index ed19dea73..ff3a8d4f9 100644 --- a/src/sixlowpan/model/sixlowpan-net-device.h +++ b/src/sixlowpan/model/sixlowpan-net-device.h @@ -510,7 +510,7 @@ class SixLowPanNetDevice : public NetDevice * \brief Get a list of the current stored fragments. * \returns The current stored fragments. */ - std::list> GetFraments() const; + std::list> GetFragments() const; /** * \brief Set the Timeout iterator. diff --git a/src/spectrum/doc/spectrum.rst b/src/spectrum/doc/spectrum.rst index ef5124800..be7118cc0 100644 --- a/src/spectrum/doc/spectrum.rst +++ b/src/spectrum/doc/spectrum.rst @@ -263,7 +263,7 @@ Here are some notes on how the spectrum module is expected to be used. is one of the main features of the spectrum module, to support inter-technology interference. For example, if you implement a WifiSpectrumPhy and a - BluetoohSpectrumPhy, and plug both on a SpectrumChannel, then you'll + BluetoothSpectrumPhy, and plug both on a SpectrumChannel, then you'll be able to simulate interference between wifi and bluetooth and vice versa. diff --git a/src/spectrum/model/spectrum-model.h b/src/spectrum/model/spectrum-model.h index 034df1913..b56a85340 100644 --- a/src/spectrum/model/spectrum-model.h +++ b/src/spectrum/model/spectrum-model.h @@ -72,7 +72,7 @@ class SpectrumModel : public SimpleRefCount { public: /** - * Comparison operator. Returns true if the two SpectumModels are identical + * Comparison operator. Returns true if the two SpectrumModels are identical * \param lhs left operand * \param rhs right operand * \returns true if the two operands are identical diff --git a/src/stats/model/get-wildcard-matches.cc b/src/stats/model/get-wildcard-matches.cc index e4f16a81a..1809e8975 100644 --- a/src/stats/model/get-wildcard-matches.cc +++ b/src/stats/model/get-wildcard-matches.cc @@ -79,7 +79,7 @@ GetWildcardMatches(const std::string& configPath, tokenStart = 0; for (i = 0; i < nonWildcardTokenCount; i++) { - // Look for the non-wilcard token. + // Look for the non-wildcard token. token = matchedPath.find(nonWildcardTokens[i], tokenStart); // Make sure that the token is found. diff --git a/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc b/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc index 87f59097f..e053c6195 100644 --- a/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc +++ b/src/test/ns3tc/fq-cobalt-queue-disc-test-suite.cc @@ -1308,7 +1308,7 @@ FqCobaltQueueDiscEcnMarking::DoRun() * * The variable outerhash stores the nearest multiple of 8 that is lesser than * the hash. When a flow hash of 20 arrives, the value of outerhash - * is 16. Since m_flowIndices[16] wasn’t previously allotted, a new flow + * is 16. Since m_flowIndices[16] wasn't previously allotted, a new flow * is created, and the tag corresponding to this queue is set to 20. */ class FqCobaltQueueDiscSetLinearProbing : public TestCase diff --git a/src/test/ns3tc/fq-codel-queue-disc-test-suite.cc b/src/test/ns3tc/fq-codel-queue-disc-test-suite.cc index 8c7405e0e..a81bdbedf 100644 --- a/src/test/ns3tc/fq-codel-queue-disc-test-suite.cc +++ b/src/test/ns3tc/fq-codel-queue-disc-test-suite.cc @@ -1372,7 +1372,7 @@ FqCoDelQueueDiscECNMarking::DoRun() * * The variable outerHash stores the nearest multiple of 8 that is lesser than * the hash. When a flow hash of 20 arrives, the value of outerHash - * is 16. Since m_flowIndices[16] wasn’t previously allotted, a new flow + * is 16. Since m_flowIndices[16] wasn't previously allotted, a new flow * is created, and the tag corresponding to this queue is set to 20. */ class FqCoDelQueueDiscSetLinearProbing : public TestCase diff --git a/src/traffic-control/examples/fqcodel-l4s-example.cc b/src/traffic-control/examples/fqcodel-l4s-example.cc index 8dcfdba75..8ba9f3434 100644 --- a/src/traffic-control/examples/fqcodel-l4s-example.cc +++ b/src/traffic-control/examples/fqcodel-l4s-example.cc @@ -775,7 +775,7 @@ main(int argc, char* argv[]) proto->SetAttribute("SocketType", TypeIdValue(n1TcpTypeId)); } - // InternetStackHelper will install a base TrafficControLayer on the node, + // InternetStackHelper will install a base TrafficControlLayer on the node, // but the Ipv4AddressHelper below will install the default FqCoDelQueueDisc // on all single device nodes. The below code overrides the configuration // that is normally done by the Ipv4AddressHelper::Install() method by diff --git a/src/wave/doc/wave.rst b/src/wave/doc/wave.rst index f01e9e862..5c11a5ced 100644 --- a/src/wave/doc/wave.rst +++ b/src/wave/doc/wave.rst @@ -30,7 +30,7 @@ applications to transmit information using WAVE. In |ns3|, the focus of the ``wave`` module is on both the MAC layer and the multi-channel coordination layer. -The key design aspect of 802.11p-compilant MAC layer is that they allow +The key design aspect of 802.11p-compliant MAC layer is that they allow communications outside the context of a basic service set (BSS). The literature uses the acronym OCB to denote "outside the context of a BSS", and the class ``ns3::OcbWifiMac`` models this in |ns3|. @@ -43,7 +43,7 @@ small delay in the MAC layer. Users can create IEEE802.11p-compliant device (the object of the class ``ns3::WifiNetDevice`` associating with ``ns3::OcbWifiMac``) . -The key design aspect of the WAVE-compilant MAC layer (including 802.11p MAC +The key design aspect of the WAVE-compliant MAC layer (including 802.11p MAC layer and 1609.4 MAC extension layer) is that, based on OCB features, they provide devices with the capability of switching between control and service channels, using a single radio or using multiple radios. Therefore devices can communicate with others in single or multiple @@ -141,7 +141,7 @@ feature has no relation to wifi MAC classes, then a new class will be defined. This approach was selected to be non-intrusive to the |ns3| wifi module. All of these classes will be hosted in a 'container' class called ``ns3:: WaveNetDevice``. This class is a subclass inheriting -from ``ns3::NetDeivce``, composed of the objects of +from ``ns3::NetDevice``, composed of the objects of ``ns3::ChannelScheduler``, ``ns3::ChannelManager``, ``ns3::ChannelCoordinator`` and ``ns3::VsaManager`` classes to provide the features described in 1609.4 while still @@ -262,7 +262,7 @@ is the data plane of the standard. Channel coordination -The class ``ns3::ChannelCoordinator`` defines the CCH Interval, SCH Interval and GuardInteval. Users can be aware of which interval the current time or +The class ``ns3::ChannelCoordinator`` defines the CCH Interval, SCH Interval and GuardInterval. Users can be aware of which interval the current time or future time will be in. If channel access mode is assigned to alternating CCH and SCH access, channel interval events will be notified repeatedly for class @@ -509,7 +509,7 @@ From , usage is as follows: // declare WAVE BSM helper instance WaveBsmHelper m_waveBsmHelper; - // the following are passed to the WaveBsmHelpe::Install() + // the following are passed to the WaveBsmHelper::Install() // method, and they are thus assumed to be created and // initialized themselves, based on the user's // simulation setup criteria. diff --git a/src/wave/model/ocb-wifi-mac.cc b/src/wave/model/ocb-wifi-mac.cc index f8f52945d..068ef63ad 100644 --- a/src/wave/model/ocb-wifi-mac.cc +++ b/src/wave/model/ocb-wifi-mac.cc @@ -488,7 +488,7 @@ OcbWifiMac::MakeVirtualBusy(Time duration) } void -OcbWifiMac::CancleTx(AcIndex ac) +OcbWifiMac::CancelTx(AcIndex ac) { NS_LOG_FUNCTION(this << ac); Ptr queue = GetQosTxop(ac); diff --git a/src/wave/model/ocb-wifi-mac.h b/src/wave/model/ocb-wifi-mac.h index 17b1152ba..c3a2e5c73 100644 --- a/src/wave/model/ocb-wifi-mac.h +++ b/src/wave/model/ocb-wifi-mac.h @@ -169,7 +169,7 @@ class OcbWifiMac : public WifiMac * To support MAC extension for multiple channel operation, * Cancel transmit operation for internal queue associated with a specified Access Category. */ - void CancleTx(AcIndex ac); + void CancelTx(AcIndex ac); /** * To support MAC extension for multiple channel operation, * Reset current MAC entity and flush its internal queues. diff --git a/src/wave/model/wave-net-device.cc b/src/wave/model/wave-net-device.cc index ef2841b0d..51ebca2e8 100644 --- a/src/wave/model/wave-net-device.cc +++ b/src/wave/model/wave-net-device.cc @@ -476,7 +476,7 @@ WaveNetDevice::CancelTx(uint32_t channelNumber, AcIndex ac) return; } Ptr mac = GetMac(channelNumber); - mac->CancleTx(ac); + mac->CancelTx(ac); } void diff --git a/src/wave/test/mac-extension-test-suite.cc b/src/wave/test/mac-extension-test-suite.cc index f24cb660a..0459543b0 100644 --- a/src/wave/test/mac-extension-test-suite.cc +++ b/src/wave/test/mac-extension-test-suite.cc @@ -1178,7 +1178,7 @@ ChannelAccessTestCase::DoRun() Ptr device = DynamicCast(m_devices.Get(i)); device->SetReceiveCallback(MakeCallback(&ChannelAccessTestCase::Receive, this)); - // at 0s, receivers are assigned ContinuosAccess from CCH, SCH1 to SCH6 + // at 0s, receivers are assigned ContinuousAccess from CCH, SCH1 to SCH6 static std::vector WaveChannels = ChannelManager::GetWaveChannels(); uint32_t channel = WaveChannels[i - 1]; const SchInfo info = SchInfo(channel, false, EXTENDED_CONTINUOUS); @@ -1301,7 +1301,7 @@ ChannelAccessTestCase::DoRun() Ptr device = DynamicCast(m_devices.Get(i)); device->SetReceiveCallback(MakeCallback(&ChannelAccessTestCase::Receive, this)); - // at 0s, receivers are assigned ContinuosAccess from CCH, SCH1 to SCH6 + // at 0s, receivers are assigned ContinuousAccess from CCH, SCH1 to SCH6 static std::vector WaveChannels = ChannelManager::GetWaveChannels(); uint32_t channel = WaveChannels[i - 1]; const SchInfo info = SchInfo(channel, false, EXTENDED_CONTINUOUS); @@ -1318,7 +1318,7 @@ ChannelAccessTestCase::DoRun() Simulator::Schedule(Seconds(0.1), &ChannelAccessTestCase::SendX, this, SCH5, 0); Simulator::Schedule(Seconds(0.1), &ChannelAccessTestCase::SendX, this, SCH6, 0); - // at 1s, the sender is assigned ContinuosAccess for SCH1, so only node-2 can receive + // at 1s, the sender is assigned ContinuousAccess for SCH1, so only node-2 can receive // packets. SchInfo info = SchInfo(SCH1, false, EXTENDED_ALTERNATING); Simulator::Schedule(Seconds(1), &WaveNetDevice::StartSch, m_sender, info); diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index b6bbf4ba9..b1af13d1e 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -180,7 +180,7 @@ RrMultiUserScheduler::SelectTxFormat() template WifiTxVector -RrMultiUserScheduler::GetTxVectorForUlMu(Func canbeSolicited) +RrMultiUserScheduler::GetTxVectorForUlMu(Func canBeSolicited) { NS_LOG_FUNCTION(this); @@ -214,7 +214,7 @@ RrMultiUserScheduler::GetTxVectorForUlMu(Func canbeSolicited) { NS_LOG_DEBUG("Next candidate STA (MAC=" << staIt->address << ", AID=" << staIt->aid << ")"); - if (!canbeSolicited(*staIt)) + if (!canBeSolicited(*staIt)) { NS_LOG_DEBUG("Skipping station based on provided function object"); staIt++; diff --git a/src/wifi/model/mgt-headers.cc b/src/wifi/model/mgt-headers.cc index 343c49ca6..82646850e 100644 --- a/src/wifi/model/mgt-headers.cc +++ b/src/wifi/model/mgt-headers.cc @@ -2357,11 +2357,11 @@ WifiActionHeader::GetAction() const case MDA_SETUP_REPLY: retval.meshAction = MDA_SETUP_REPLY; break; - case MDAOP_ADVERTISMENT_REQUEST: - retval.meshAction = MDAOP_ADVERTISMENT_REQUEST; + case MDAOP_ADVERTISEMENT_REQUEST: + retval.meshAction = MDAOP_ADVERTISEMENT_REQUEST; break; - case MDAOP_ADVERTISMENTS: - retval.meshAction = MDAOP_ADVERTISMENTS; + case MDAOP_ADVERTISEMENTS: + retval.meshAction = MDAOP_ADVERTISEMENTS; break; case MDAOP_SET_TEARDOWN: retval.meshAction = MDAOP_SET_TEARDOWN; diff --git a/src/wifi/model/mgt-headers.h b/src/wifi/model/mgt-headers.h index 632500f4a..7de26aa10 100644 --- a/src/wifi/model/mgt-headers.h +++ b/src/wifi/model/mgt-headers.h @@ -1354,9 +1354,9 @@ class WifiActionHeader : public Header 4, // Action Value:4 in Category 13: Mesh MCCA-Setup-Request (not used so far) MDA_SETUP_REPLY = 5, // Action Value:5 in Category 13: Mesh MCCA-Setup-Reply (not used so far) - MDAOP_ADVERTISMENT_REQUEST = + MDAOP_ADVERTISEMENT_REQUEST = 6, // Action Value:6 in Category 13: Mesh MCCA-Advertisement-Request (not used so far) - MDAOP_ADVERTISMENTS = 7, // Action Value:7 in Category 13: Mesh (not used so far) + MDAOP_ADVERTISEMENTS = 7, // Action Value:7 in Category 13: Mesh (not used so far) MDAOP_SET_TEARDOWN = 8, // Action Value:8 in Category 13: Mesh (not used so far) TBTT_ADJUSTMENT_REQUEST = 9, // Action Value:9 in Category 13: Mesh (not used so far) TBTT_ADJUSTMENT_RESPONSE = 10, // Action Value:10 in Category 13: Mesh (not used so far) diff --git a/src/wifi/model/rate-control/aparf-wifi-manager.cc b/src/wifi/model/rate-control/aparf-wifi-manager.cc index 2146ea40e..672132d81 100644 --- a/src/wifi/model/rate-control/aparf-wifi-manager.cc +++ b/src/wifi/model/rate-control/aparf-wifi-manager.cc @@ -70,13 +70,13 @@ AparfWifiManager::GetTypeId() "The minimum number of successful transmissions in \"High\" state to try " "a new power or rate.", UintegerValue(3), - MakeUintegerAccessor(&AparfWifiManager::m_succesMax1), + MakeUintegerAccessor(&AparfWifiManager::m_successMax1), MakeUintegerChecker()) .AddAttribute("SuccessThreshold2", "The minimum number of successful transmissions in \"Low\" state to try " "a new power or rate.", UintegerValue(10), - MakeUintegerAccessor(&AparfWifiManager::m_succesMax2), + MakeUintegerAccessor(&AparfWifiManager::m_successMax2), MakeUintegerChecker()) .AddAttribute("FailThreshold", "The minimum number of failed transmissions to try a new power or rate.", @@ -162,7 +162,7 @@ AparfWifiManager::DoCreateStation() const NS_LOG_FUNCTION(this); AparfWifiRemoteStation* station = new AparfWifiRemoteStation(); - station->m_successThreshold = m_succesMax1; + station->m_successThreshold = m_successMax1; station->m_failThreshold = m_failMax; station->m_nSuccess = 0; station->m_nFailed = 0; @@ -217,12 +217,12 @@ AparfWifiManager::DoReportDataFailed(WifiRemoteStation* st) if (station->m_aparfState == AparfWifiManager::Low) { station->m_aparfState = AparfWifiManager::High; - station->m_successThreshold = m_succesMax1; + station->m_successThreshold = m_successMax1; } else if (station->m_aparfState == AparfWifiManager::Spread) { station->m_aparfState = AparfWifiManager::Low; - station->m_successThreshold = m_succesMax2; + station->m_successThreshold = m_successMax2; } if (station->m_nFailed == station->m_failThreshold) @@ -291,7 +291,7 @@ AparfWifiManager::DoReportDataOk(WifiRemoteStation* st, else if (station->m_aparfState == AparfWifiManager::Spread) { station->m_aparfState = AparfWifiManager::High; - station->m_successThreshold = m_succesMax1; + station->m_successThreshold = m_successMax1; } if (station->m_nSuccess == station->m_successThreshold) diff --git a/src/wifi/model/rate-control/aparf-wifi-manager.h b/src/wifi/model/rate-control/aparf-wifi-manager.h index b7c8817c8..2ccee357d 100644 --- a/src/wifi/model/rate-control/aparf-wifi-manager.h +++ b/src/wifi/model/rate-control/aparf-wifi-manager.h @@ -92,10 +92,10 @@ class AparfWifiManager : public WifiRemoteStationManager */ void CheckInit(AparfWifiRemoteStation* station); - uint32_t m_succesMax1; //!< The minimum number of successful transmissions in \"High\" state to - //!< try a new power or rate. - uint32_t m_succesMax2; //!< The minimum number of successful transmissions in \"Low\" state to - //!< try a new power or rate. + uint32_t m_successMax1; //!< The minimum number of successful transmissions in \"High\" state to + //!< try a new power or rate. + uint32_t m_successMax2; //!< The minimum number of successful transmissions in \"Low\" state to + //!< try a new power or rate. uint32_t m_failMax; //!< The minimum number of failed transmissions to try a new power or rate. uint32_t m_powerMax; //!< The maximum number of power changes. uint8_t m_powerInc; //!< Step size for increment the power. diff --git a/src/wifi/model/wifi-information-element.h b/src/wifi/model/wifi-information-element.h index 0ea914db0..2d21bc246 100644 --- a/src/wifi/model/wifi-information-element.h +++ b/src/wifi/model/wifi-information-element.h @@ -199,7 +199,7 @@ typedef uint8_t WifiInformationElementId; #define IE_CLUSTER_REPORT ((WifiInformationElementId)166) #define IE_RELAY_CAPABILITIES ((WifiInformationElementId)167) #define IE_RELAY_TRANSFER_PARAMETER_SET ((WifiInformationElementId)168) -#define IE_BEAMLINK_MAINENANCE ((WifiInformationElementId)169) +#define IE_BEAMLINK_MAINTENANCE ((WifiInformationElementId)169) // 170 to 171 are reserved #define IE_DMG_LINK_ADAPTATION_ACKNOWLEDGMENT ((WifiInformationElementId)172) // 173 is reserved diff --git a/src/wifi/model/wifi-radio-energy-model.h b/src/wifi/model/wifi-radio-energy-model.h index 206900df9..61a3b18fe 100644 --- a/src/wifi/model/wifi-radio-energy-model.h +++ b/src/wifi/model/wifi-radio-energy-model.h @@ -170,7 +170,7 @@ class WifiRadioEnergyModel : public DeviceEnergyModel ~WifiRadioEnergyModel() override; /** - * \brief Sets pointer to EnergySouce installed on node. + * \brief Sets pointer to EnergySource installed on node. * * \param source Pointer to EnergySource installed on node. * diff --git a/src/wifi/test/tx-duration-test.cc b/src/wifi/test/tx-duration-test.cc index 2d7733b31..cb029e2d3 100644 --- a/src/wifi/test/tx-duration-test.cc +++ b/src/wifi/test/tx-duration-test.cc @@ -303,7 +303,7 @@ TxDurationTest::CheckMuTxDuration(std::list sizes, MicroSeconds(6); // 2.4 GHz band should be at the end of the bands to test } Time calculatedDuration = NanoSeconds(0); - uint32_t longuestSize = 0; + uint32_t longestSize = 0; auto iterStaId = staIds.begin(); for (auto& size : sizes) { @@ -313,7 +313,7 @@ TxDurationTest::CheckMuTxDuration(std::list sizes, { calculatedDuration = ppduDurationForSta; staId = *iterStaId; - longuestSize = size; + longestSize = size; } ++iterStaId; } @@ -322,7 +322,7 @@ TxDurationTest::CheckMuTxDuration(std::list sizes, if (calculatedDuration != knownDuration || calculatedDuration != calculatedDurationUsingList) { - std::cerr << "size=" << longuestSize << " band=" << testedBand << " staId=" << staId + std::cerr << "size=" << longestSize << " band=" << testedBand << " staId=" << staId << " nss=" << +txVector.GetNss(staId) << " mode=" << txVector.GetMode(staId) << " channelWidth=" << channelWidth << " guardInterval=" << guardInterval << " datarate=" diff --git a/src/wimax/model/bs-net-device.cc b/src/wimax/model/bs-net-device.cc index 398e09818..d96435031 100644 --- a/src/wimax/model/bs-net-device.cc +++ b/src/wimax/model/bs-net-device.cc @@ -639,7 +639,7 @@ BaseStationNetDevice::DoSend(Ptr packet, NS_LOG_INFO("BS (" << source << "):"); NS_LOG_INFO("\tSending packet..."); NS_LOG_INFO("\t\tDestination: " << dest); - NS_LOG_INFO("\t\tPaket Size: " << packet->GetSize()); + NS_LOG_INFO("\t\tPacket Size: " << packet->GetSize()); NS_LOG_INFO("\t\tProtocol: " << protocolNumber); if (protocolNumber == 2048) diff --git a/src/wimax/model/bs-uplink-scheduler-rtps.cc b/src/wimax/model/bs-uplink-scheduler-rtps.cc index 8adc5c479..a6e495fe4 100644 --- a/src/wimax/model/bs-uplink-scheduler-rtps.cc +++ b/src/wimax/model/bs-uplink-scheduler-rtps.cc @@ -632,7 +632,7 @@ UplinkSchedulerRtps::ULSchedulerRTPSConnection(uint32_t& symbolsToAllocation, NS_LOG_INFO("\t\tUpdateGrantedBandwidth for " << i << " = " << allocSizeBytes); if (record_[i]->GetRequestedBandwidth() < allocSizeBytes) { - // the flow need new poll to set the newer requredBandwidth + // the flow need new poll to set the newer requiredBandwidth record_[i]->SetGrantedBandwidth(0); record_[i]->SetRequestedBandwidth(0); } diff --git a/src/wimax/model/cid-factory.h b/src/wimax/model/cid-factory.h index 25f1015e1..07a8d03a0 100644 --- a/src/wimax/model/cid-factory.h +++ b/src/wimax/model/cid-factory.h @@ -35,7 +35,7 @@ namespace ns3 * This class uses the definitions from Table 345 in ieee-802.16-2004 to * allocate cids in different integer ranges according to their type. * The relative allocation of the ranges is controlled by the parameter 'm' - * introduced in the above-mentionned table. + * introduced in the above-mentioned table. * * Note: The current implementation merely allocates cids sequentially from * the start of the allowed range. A proper implementation would be able diff --git a/src/wimax/model/simple-ofdm-wimax-phy.cc b/src/wimax/model/simple-ofdm-wimax-phy.cc index c53ba37e2..f9330b56b 100644 --- a/src/wimax/model/simple-ofdm-wimax-phy.cc +++ b/src/wimax/model/simple-ofdm-wimax-phy.cc @@ -180,7 +180,7 @@ SimpleOfdmWimaxPhy::InitSimpleOfdmWimaxPhy() m_txPower = 30; // dBm SetBandwidth(10000000); // 10Mhz m_nbErroneousBlock = 0; - m_nrRecivedFecBlocks = 0; + m_nrReceivedFecBlocks = 0; m_snrToBlockErrorRateManager = new SNRToBlockErrorRateManager(); } @@ -412,7 +412,7 @@ SimpleOfdmWimaxPhy::StartReceive(uint32_t burstSize, delete record; NS_LOG_INFO("PHY: Receive rxPower=" << rxPower << ", Nwb=" << Nwb << ", SNR=" << SNR - << ", Modulation=" << modulationType << ", BlocErrorRate=" + << ", Modulation=" << modulationType << ", BlockErrorRate=" << blockErrorRate << ", drop=" << std::boolalpha << drop); switch (GetState()) @@ -433,7 +433,7 @@ SimpleOfdmWimaxPhy::StartReceive(uint32_t burstSize, { NotifyRxBegin(burst); m_receivedFecBlocks->clear(); - m_nrRecivedFecBlocks = 0; + m_nrReceivedFecBlocks = 0; SetBlockParameters(burstSize, modulationType); m_blockTime = GetBlockTransmissionTime(modulationType); } @@ -469,14 +469,14 @@ SimpleOfdmWimaxPhy::EndReceiveFecBlock(uint32_t burstSize, Ptr burst) { SetState(PHY_STATE_IDLE); - m_nrRecivedFecBlocks++; + m_nrReceivedFecBlocks++; if (drop == true) { m_nbErroneousBlock++; } - if ((uint32_t)m_nrRecivedFecBlocks * m_blockSize == burstSize * 8 + m_paddingBits) + if ((uint32_t)m_nrReceivedFecBlocks * m_blockSize == burstSize * 8 + m_paddingBits) { NotifyRxEnd(burst); if (m_nbErroneousBlock == 0) @@ -488,7 +488,7 @@ SimpleOfdmWimaxPhy::EndReceiveFecBlock(uint32_t burstSize, NotifyRxDrop(burst); } m_nbErroneousBlock = 0; - m_nrRecivedFecBlocks = 0; + m_nrReceivedFecBlocks = 0; } } @@ -619,8 +619,8 @@ SimpleOfdmWimaxPhy::RecreateBuffer() uint32_t i = 0; for (uint32_t j = 0; j < m_nrBlocks; j++) { - Bvec tmpRecFecBloc = m_receivedFecBlocks->front(); - buffer.insert(buffer.begin() + i, tmpRecFecBloc.begin(), tmpRecFecBloc.end()); + Bvec tmpRecFecBlock = m_receivedFecBlocks->front(); + buffer.insert(buffer.begin() + i, tmpRecFecBlock.begin(), tmpRecFecBlock.end()); m_receivedFecBlocks->pop_front(); i += m_blockSize; } diff --git a/src/wimax/model/simple-ofdm-wimax-phy.h b/src/wimax/model/simple-ofdm-wimax-phy.h index 3aba1dcca..8265de9ad 100644 --- a/src/wimax/model/simple-ofdm-wimax-phy.h +++ b/src/wimax/model/simple-ofdm-wimax-phy.h @@ -467,7 +467,7 @@ class SimpleOfdmWimaxPhy : public WimaxPhy uint16_t m_blockSize; ///< block size uint32_t m_paddingBits; ///< padding bits uint16_t m_nbErroneousBlock; ///< erroneous blocks - uint16_t m_nrRecivedFecBlocks; ///< number received FEC blocks + uint16_t m_nrReceivedFecBlocks; ///< number received FEC blocks uint16_t m_nfft; ///< NFFT double m_g; ///< G value double m_bandWidth; ///< bandwidth diff --git a/src/wimax/model/ss-link-manager.cc b/src/wimax/model/ss-link-manager.cc index 0fc66598a..f564ad0ec 100644 --- a/src/wimax/model/ss-link-manager.cc +++ b/src/wimax/model/ss-link-manager.cc @@ -284,7 +284,7 @@ SSLinkManager::StartContentionResolution() void SSLinkManager::PerformBackoff() { - Time defferTime = Seconds(0); + Time deferTime = Seconds(0); Time timeToAllocation = Seconds(0); uint16_t nrPsPerRangOpp = m_ss->GetCurrentUcd().GetChannelEncodings().GetRangReqOppSize(); uint16_t oppSize = m_ss->GetCurrentUcd().GetChannelEncodings().GetRangReqOppSize() / @@ -294,9 +294,9 @@ SSLinkManager::PerformBackoff() { if (m_rangingBO == 0) { - defferTime = + deferTime = Seconds(deferTOs * nrPsPerRangOpp * m_ss->GetPhy()->GetPsDuration().GetSeconds()); - timeToAllocation = m_ss->GetTimeToAllocation(defferTime); + timeToAllocation = m_ss->GetTimeToAllocation(deferTime); Simulator::Schedule(timeToAllocation, &SSLinkManager::SendRangingRequest, diff --git a/src/wimax/model/ss-net-device.cc b/src/wimax/model/ss-net-device.cc index ce92f03ff..45a1fa629 100644 --- a/src/wimax/model/ss-net-device.cc +++ b/src/wimax/model/ss-net-device.cc @@ -672,7 +672,7 @@ SubscriberStationNetDevice::DoSend(Ptr packet, else { NS_LOG_DEBUG("SS (" << GetMacAddress() << ")"); - NS_LOG_INFO("\tCan't send packet! (NotRegitered with the network)"); + NS_LOG_INFO("\tCan't send packet! (NotRegistered with the network)"); return false; } diff --git a/src/wimax/model/wimax-net-device.h b/src/wimax/model/wimax-net-device.h index c35d7f595..ea8947c6a 100644 --- a/src/wimax/model/wimax-net-device.h +++ b/src/wimax/model/wimax-net-device.h @@ -64,7 +64,7 @@ class UplinkScheduler; * \ingroup wimax * * This class holds together ns3::WimaxPhy, ns3::WimaxConnection, - * ns3::ConectionManager, ns3::BurstProfileManager, and + * ns3::ConnectionManager, ns3::BurstProfileManager, and * ns3::BandwidthManager. */ class WimaxNetDevice : public NetDevice diff --git a/utils/codespell-ignored-lines b/utils/codespell-ignored-lines index 085de63b9..070683325 100644 --- a/utils/codespell-ignored-lines +++ b/utils/codespell-ignored-lines @@ -44,3 +44,80 @@ Network Animator nam. It is not possible to run a simulation #./src/internet-apps/model/v4ping.h:37 * \brief an application which sends one ICMP ECHO request, waits for a REPLYs + +#./src/openflow/model/openflow-switch-net-device.cc:544, 548 + arp_h->ar_tha); // Target hardware address. + arp_h->ar_hln = sizeof arp_h->ar_tha; // Hardware address length. + +./src/dsr/model/dsr-routing.cc:243, 246, 3360, 3363 + .AddAttribute("GratReplyHoldoff", + MakeTimeAccessor(&DsrRouting::m_gratReplyHoldoff), + m_gratReplyHoldoff))) // Find the gratuitous reply entry + GraReplyEntry graReplyEntry(source, srcAddress, m_gratReplyHoldoff + Simulator::Now()); + +./src/dsr/model/dsr-routing.h:882 + Time m_gratReplyHoldoff; ///< The max gratuitous reply hold off time + +./src/dsr/model/dsr-gratuitous-reply-table.cc:75, 76 + i->m_gratReplyHoldoff = + std::max(gratReplyHoldoff + Simulator::Now(), i->m_gratReplyHoldoff); + +./src/dsr/model/dsr-gratuitous-reply-table.h:54, 66, 137 + Time m_gratReplyHoldoff; ///< gratuitous reply holdoff time + m_gratReplyHoldoff(h) + return (b.m_gratReplyHoldoff < Simulator::Now()); + +./RELEASE_NOTES.md:1087 +- Bug 2530 - aodv: Rename aodv::SetBalckListTimeout to aodv::SetBlackListTimeout + +./doc/installation/source/linux.rst:122 + apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 + +./doc/tutorial/source/getting-started.rst:347: + >> Searching for system dependency gir-bindings - OK + +./src/wave/examples/vanet-routing-compare.cc:1565, 1971 +static ns3::GlobalValue g_rate("VRCrate", + GlobalValue::GetValueByName("VRCrate", stringValue); + +./src/lte/model/lte-mi-error-model.h:23: + * for mobIlE Video AppLications) project, which is a + +./src/traffic-control/model/codel-queue-disc.h:17: + * Codel, the COntrolled DELay Queueing discipline + +./src/internet/model/global-route-manager-impl.h:555: + * \param vs a list of SPFVertexes + +./src/internet/model/candidate-queue.h:166: + * SPFVertexes are added into the queue according to the ordering + +./src/internet/model/global-route-manager-impl.h:555 + typedef std::list ListOfSPFVertex_t; //!< container of SPFVertexes + +./CHANGES.md: +* (mesh) The spelling of the function `PeerManagementProtocolMac::SetPeerManagerProtcol` from `peer-management-protocol-mac.h` was corrected to `PeerManagementProtocolMac::SetPeerManagerProtocol`; this will affect existing users who were using the function with the misspelling. +* The spelling of the attribute `IntialCellVoltage` from `LiIonEnergySource` was corrected to `InitialCellVoltage`; this will affect existing users who were using the attribute with the misspelling. +* (dsr) The spelling of the class `DsrOptionRerrUnsupportHeader` from `dsr-option-header.h` was corrected to `DsrOptionRerrUnsupportedHeader`; this will affect existing users who were using the class with the misspelling. +* (internet) The spelling of the enumerated value `IPV6_EXT_AUTHENTIFICATION` from `ipv6-header.h` was corrected to `IPV6_EXT_AUTHENTICATION`; this will affect existing users who were using the enumerated value with the misspelling. +* (lte) The spelling of the enumeration `ControPduType_t` from `lte-rlc-am-header.h` was corrected to `ControlPduType_t`; this will affect existing users who were using the enumeration with the misspelling. +* (lte) The spelling of the function `LteUeCphySapProvider::StartInSnycDetection()` from `lte-ue-cphy-sap.h` was corrected to `LteUeCphySapProvider::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (lte) The spelling of the function `MemberLteUeCphySapProvider::StartInSnycDetection()` from `lte-ue-cphy-sap.h` was corrected to `MemberLteUeCphySapProvider::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (lte) The spelling of the function `LteUePhy::StartInSnycDetection()` from `lte-ue-phy.h` was corrected to `LteUePhy::StartInSyncDetection()`; this will affect existing users who were using the function with the misspelling. +* (network) The spelling of the file `lollipop-comparisions.cc` was corrected to `lollipop-comparisons.cc`. +* (network) The spelling of the attribute `currentTrimedFromStart` from `packet-metadata.h` was corrected to `currentTrimmedFromStart`; this will affect existing users who were using the attribute with the misspelling. +* (network) The spelling of the attribute `currentTrimedFromEnd` from `packet-metadata.h` was corrected to `currentTrimmedFromEnd`; this will affect existing users who were using the attribute with the misspelling. +* (wave) The spelling of the function `OcbWifiMac::CancleTx()` from `ocb-wifi-mac.h` was corrected to `OcbWifiMac::CancelTx()`; this will affect existing users who were using the function with the misspelling. +* (wifi) The spelling of the attribute `m_succesMax1` from `aparf-wifi-manager.h` was corrected to `m_successMax1`; this will affect existing users who were using the attribute with the misspelling. +* (wifi) The spelling of the attribute `m_succesMax2` from `aparf-wifi-manager.h` was corrected to `m_successMax2`; this will affect existing users who were using the attribute with the misspelling. +* (wifi) The spelling of the enumerated value `MDAOP_ADVERTISMENT_REQUEST` from `mgmt-headers.h` was corrected to `MDAOP_ADVERTISEMENT_REQUEST`; this will affect existing users who were using the enumerated value with the misspelling. +* (wifi) The spelling of the enumerated value `MDAOP_ADVERTISMENTS` from `mgmt-headers.h` was corrected to `MDAOP_ADVERTISEMENTS`; this will affect existing users who were using the enumerated value with the misspelling. +* (wifi) The spelling of the define `IE_BEAMLINK_MAINENANCE` from `wifi-information-element.h` was corrected to `IE_BEAMLINK_MAINTENANCE`; this will affect existing users who were using the define with the misspelling. +* (wimax) The spelling of the attribute `m_nrRecivedFecBlocks` from `simple-ofdm-wimax-phy.h` was corrected to `m_nrReceivedFecBlocks`; this will affect existing users who were using the attribute with the misspelling. +* (lte) The spelling of the function `DoUlInfoListElementHarqFeeback` from `lte-enb-phy-sap.h` and `lte-enb-mac.h` was corrected to `DoUlInfoListElementHarqFeedback`; this will affect existing users who were using the function with the mispelling. +* (lte) The spelling of the function `DoDlInfoListElementHarqFeeback` from `lte-enb-phy-sap.h` and `lte-enb-mac.h` was corrected to `DoDlInfoListElementHarqFeedback`; this will affect existing users who were using the function with the mispelling. +* (lr-wpan) The spelling of the constant `aMaxBeaconPayloadLenght` from `lr-wpan-constants.h` was corrected to `aMaxBeaconPayloadLength`; this will affect existing users who were using the constant value with the misspelling. +* (sixlowpan) The spelling of the function `SixLowPanNetDevice::Fragments::GetFraments` from `sixlowpan-net-device.cc` was corrected to `SixLowPanNetDevice::Fragments::GetFragments`; this will affect existing users who were using the function with the misspelling. +* The attribute `Recievers` in class `YansWifiPhy` was misspelled, so this has been corrected to `Receivers`. + + diff --git a/utils/codespell-ignored-words b/utils/codespell-ignored-words index 7ccab4b3e..1e3ca01f7 100644 --- a/utils/codespell-ignored-words +++ b/utils/codespell-ignored-words @@ -1,3 +1,6 @@ +#LaTeX +te + #Core anid anumber @@ -17,6 +20,7 @@ ect iif nce inflight +upto #Internet Apps clen @@ -26,6 +30,7 @@ nin #DSR cleanp +grat #LTE commun @@ -48,6 +53,7 @@ fo #Traffic Control taht +interm #Wimax opps From b085bae2bca225338fb968bc50ef3110b756e229 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sun, 19 Mar 2023 14:07:50 -0300 Subject: [PATCH 012/434] dsr: mark operator<<(std::ostream& os, const DsrOptionSRHeader& sr) as [[maybe_unused]] --- src/dsr/model/dsr-option-header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dsr/model/dsr-option-header.h b/src/dsr/model/dsr-option-header.h index b1be00246..19d8fb474 100644 --- a/src/dsr/model/dsr-option-header.h +++ b/src/dsr/model/dsr-option-header.h @@ -1335,7 +1335,7 @@ class DsrOptionAckHeader : public DsrOptionHeader Ipv4Address m_realDstAddress; }; -static inline std::ostream& +[[maybe_unused]] static inline std::ostream& operator<<(std::ostream& os, const DsrOptionSRHeader& sr) { sr.Print(os); From e96d1e0fac941cbfdf673b105bc9b9afbcfa9ebf Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Thu, 16 Mar 2023 16:54:59 +0000 Subject: [PATCH 013/434] ci: Unify clang-tidy and clang-tidy-diff jobs --- utils/tests/gitlab-ci-code-linting.yml | 79 +++++++++----------------- 1 file changed, 28 insertions(+), 51 deletions(-) diff --git a/utils/tests/gitlab-ci-code-linting.yml b/utils/tests/gitlab-ci-code-linting.yml index 537ebd784..5b94eb289 100644 --- a/utils/tests/gitlab-ci-code-linting.yml +++ b/utils/tests/gitlab-ci-code-linting.yml @@ -16,7 +16,7 @@ check-style-clang-format: timeout: 1h # Clang-tidy -.base-clang-tidy: +clang-tidy: stage: code-linting image: ubuntu:latest variables: @@ -36,62 +36,39 @@ check-style-clang-format: --enable-clang-tidy --enable-examples --enable-tests --enable-asserts --enable-mpi --enable-python-bindings + script: + - if (git remote | grep -qw upstream) ; then + git remote set-url upstream https://gitlab.com/nsnam/ns-3-dev.git ; + else + git remote add upstream https://gitlab.com/nsnam/ns-3-dev.git ; + fi + - git fetch upstream $CI_DEFAULT_BRANCH + + # Run clang-tidy-diff. If running on default branch, Git diff is empty and this is ignored. + # File paths generated by git diff are relative to the working tree. Therefore, iregex should only contain paths relative to the working tree. + - git diff -U0 upstream/$CI_DEFAULT_BRANCH | + clang-tidy-diff-14.py -path cmake-cache/ -p1 -quiet -use-color + -iregex "(contrib|examples|src|scratch|utils)\/.+\.(cpp|cc|cxx|c|h|hpp)" + 1> $CLANG_TIDY_OUTPUT + 2> /dev/null + + # Run full clang-tidy in the following cases: 1) default branch, 2) ".clang-tidy" file changed, 3) clang-tidy-diff had an error + - if [ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ] || (git diff -U0 --name-only upstream/$CI_DEFAULT_BRANCH | grep -q ".clang-tidy") || (egrep -q -A 3 "file not found \[clang-diagnostic-error\]" $CLANG_TIDY_OUTPUT) ; then + echo "Running full clang-tidy" ; + run-clang-tidy-14 -p cmake-cache/ -quiet + 1> $CLANG_TIDY_OUTPUT + 2> /dev/null ; + fi + + # Check job results + - (! egrep -A 3 "error:|warning:|note:" $CLANG_TIDY_OUTPUT) + - echo "No clang-tidy errors found" artifacts: paths: - $CLANG_TIDY_OUTPUT when: on_failure timeout: 3h -clang-tidy: - extends: .base-clang-tidy - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: never - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: on_success - - changes: - paths: - - .clang-tidy - compare_to: master - when: on_success - script: - - run-clang-tidy-14 -p cmake-cache/ -quiet - 1> $CLANG_TIDY_OUTPUT - 2> /dev/null - - (! egrep -A 3 "error:|warning:|note:" $CLANG_TIDY_OUTPUT) - - echo "No clang-tidy errors found" - -clang-tidy-diff: - extends: .base-clang-tidy - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: never - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: never - - changes: - paths: - - .clang-tidy - compare_to: master - when: never - - when: on_success - script: - - git remote add upstream https://gitlab.com/nsnam/ns-3-dev.git - - git fetch upstream master - # File paths generated by git diff are relative to the working tree. Therefore, iregex should only contain paths relative to the working tree. - - git diff -U0 upstream/master | - clang-tidy-diff-14.py -path cmake-cache/ -p1 -quiet -use-color - -iregex "(contrib|examples|src|scratch|utils)\/.+\.(cpp|cc|cxx|c|h|hpp)" - 1> $CLANG_TIDY_OUTPUT - 2> /dev/null - - if egrep -A 3 "file not found \[clang-diagnostic-error\]" $CLANG_TIDY_OUTPUT ; then - echo "Clang-tidy could not find the above files. Running a full clang-tidy check." ; - run-clang-tidy-14 -p cmake-cache/ -quiet - 1> $CLANG_TIDY_OUTPUT - 2> /dev/null ; - fi - - (! egrep -A 3 "error:|warning:|note:" $CLANG_TIDY_OUTPUT) - - echo "No clang-tidy errors found" - # Emacs line emacs-line: stage: code-linting From 8a31ae62a2cffbec706d50fc7e40bdf0fea08c60 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sun, 19 Mar 2023 12:09:34 -0700 Subject: [PATCH 014/434] doc: Update menu headers to include Installation guide --- doc/ns3_html_theme/layout.html | 3 +++ doc/ns3_html_theme/ns3_doxy_header.html | 2 +- doc/ns3_html_theme/static/ns3_links.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ns3_html_theme/layout.html b/doc/ns3_html_theme/layout.html index f167dda17..0140ac840 100644 --- a/doc/ns3_html_theme/layout.html +++ b/doc/ns3_html_theme/layout.html @@ -74,6 +74,9 @@
+ Installation
Manual
diff --git a/doc/ns3_html_theme/ns3_doxy_header.html b/doc/ns3_html_theme/ns3_doxy_header.html index 75afc8243..8617f677d 100644 --- a/doc/ns3_html_theme/ns3_doxy_header.html +++ b/doc/ns3_html_theme/ns3_doxy_header.html @@ -70,7 +70,7 @@ $extrastylesheet
- Installation
Date: Thu, 23 Mar 2023 16:39:47 +0000 Subject: [PATCH 015/434] core: (fixes #855) Add caching to lognormal RNG --- src/core/model/random-variable-stream.cc | 14 +++++++++++++- src/core/model/random-variable-stream.h | 9 +++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/core/model/random-variable-stream.cc b/src/core/model/random-variable-stream.cc index 5d1d30dce..cddb88b71 100644 --- a/src/core/model/random-variable-stream.cc +++ b/src/core/model/random-variable-stream.cc @@ -802,6 +802,7 @@ LogNormalRandomVariable::GetTypeId() } LogNormalRandomVariable::LogNormalRandomVariable() + : m_nextValid(false) { // m_mu and m_sigma are initialized after constructor by // attributes @@ -851,6 +852,14 @@ LogNormalRandomVariable::GetSigma() const double LogNormalRandomVariable::GetValue(double mu, double sigma) { + if (m_nextValid) + { // use previously generated + m_nextValid = false; + double normal = m_v2 * m_normal; + + return std::exp(sigma * normal + mu); + } + double v1; double v2; double r2; @@ -878,7 +887,10 @@ LogNormalRandomVariable::GetValue(double mu, double sigma) r2 = v1 * v1 + v2 * v2; } while (r2 > 1.0 || r2 == 0); - normal = v1 * std::sqrt(-2.0 * std::log(r2) / r2); + m_normal = std::sqrt(-2.0 * std::log(r2) / r2); + normal = v1 * m_normal; + m_nextValid = true; + m_v2 = v2; x = std::exp(sigma * normal + mu); diff --git a/src/core/model/random-variable-stream.h b/src/core/model/random-variable-stream.h index 6feb07648..96fcd8601 100644 --- a/src/core/model/random-variable-stream.h +++ b/src/core/model/random-variable-stream.h @@ -1175,6 +1175,15 @@ class LogNormalRandomVariable : public RandomVariableStream /** The sigma value for the log-normal distribution returned by this RNG stream. */ double m_sigma; + /** True if m_normal is valid. */ + bool m_nextValid; + + /** The algorithm produces two values at a time. Cache parameters for possible reuse.*/ + double m_v2; + + /** The algorithm produces two values at a time. Cache parameters for possible reuse.*/ + double m_normal; + }; // class LogNormalRandomVariable /** From 8afeb5249c8a330213902e4e17a27525b0e5d6e0 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Fri, 3 Mar 2023 12:06:01 +0900 Subject: [PATCH 016/434] lr-wpan: Orphan scan support --- CHANGES.md | 2 + RELEASE_NOTES.md | 2 + src/lr-wpan/doc/lr-wpan.rst | 11 +- src/lr-wpan/examples/CMakeLists.txt | 1 + src/lr-wpan/examples/lr-wpan-orphan-scan.cc | 215 ++++++++++++ src/lr-wpan/model/lr-wpan-csmaca.cc | 4 +- src/lr-wpan/model/lr-wpan-mac-pl-headers.cc | 77 ++++- src/lr-wpan/model/lr-wpan-mac-pl-headers.h | 70 +++- src/lr-wpan/model/lr-wpan-mac.cc | 360 +++++++++++++++++--- src/lr-wpan/model/lr-wpan-mac.h | 122 +++++-- src/lr-wpan/test/lr-wpan-mac-test.cc | 228 +++++++++++-- 11 files changed, 994 insertions(+), 98 deletions(-) create mode 100644 src/lr-wpan/examples/lr-wpan-orphan-scan.cc diff --git a/CHANGES.md b/CHANGES.md index 6f4e46cb4..0afc469d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,8 @@ Changes from ns-3.38 to ns-3-dev ### New API +* (lr-wpan) Added support for orphan scans. Orphan scans can now be performed using the existing `LrWpanMac::MlmeScanRequest`; This orphan scan use the added orphan notification commands and coordinator realigment commands. Usage is shown in added `lr-wpan-orphan-scan.cc` example and in the `TestOrphanScan` included in `lr-wpan-mac-test.cc`. + ### Changes to existing API * (dsr) The spelling of the class `DsrOptionRerrUnsupportHeader` from `dsr-option-header.h` was corrected to `DsrOptionRerrUnsupportedHeader`; this will affect existing users who were using the class with the misspelling. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 50e27ffcf..e99d528ed 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,6 +20,8 @@ Release 3-dev ### New user-visible features +- (lr-wpan) !1399 - Add orphan scan support. + ### Bugs fixed Release 3.38 diff --git a/src/lr-wpan/doc/lr-wpan.rst b/src/lr-wpan/doc/lr-wpan.rst index a94300d2f..25d2bee6b 100644 --- a/src/lr-wpan/doc/lr-wpan.rst +++ b/src/lr-wpan/doc/lr-wpan.rst @@ -155,11 +155,11 @@ IEEE 802.15.4 supports 4 types of scanning: * *Energy Detection (ED) Scan:* In an energy scan, a device or a coordinator scan a set number of channels looking for traces of energy. The maximum energy registered during a given amount of time is stored. Energy scan is typically used to measure the quality of a channel at any given time. For this reason, coordinators often use this scan before initiating a PAN on a channel. -* *Active Scan:* A device sends beacon requests on a set number of channels looking for a PAN coordinator. The receiving coordinator must be configured on non-beacon mode. Coordinators on beacon-mode ignore these requests. The coordinators who accept the request, respond with a beacon. After an active scan take place, during the association process devices extract the information in the PAN descriptors from the collected beacons and based on this information (e.g. channel, LQI level), choose a coordinator to associate with. +* *Active Scan:* A device sends ``beacon request commands`` on a set number of channels looking for a PAN coordinator. The receiving coordinator must be configured on non-beacon mode. Coordinators on beacon-mode ignore these requests. The coordinators who accept the request, respond with a beacon. After an active scan take place, during the association process devices extract the information in the PAN descriptors from the collected beacons and based on this information (e.g. channel, LQI level), choose a coordinator to associate with. -* *Passive Scan:* In a passive scan, no beacon requests are sent. Devices scan a set number of channels looking for beacons currently being transmitted (coordinators in beacon-mode). Like in the active scan, the information from beacons is stored in PAN descriptors and used by the device to choose a coordinator to associate with. +* *Passive Scan:* In a passive scan, no ``beacon requests commands`` are sent. Devices scan a set number of channels looking for beacons currently being transmitted (coordinators in beacon-mode). Like in the active scan, the information from beacons is stored in PAN descriptors and used by the device to choose a coordinator to associate with. -* *Orphan Scan:* +* *Orphan Scan:* Orphan scan is used typically by device as a result of repeated communication failure attempts with a coordinator. In other words, an orphan scan represents the intent of a device to relocate its coordinator. In some situations, it can be used by devices higher layers to not only rejoin a network but also join a network for the first time. In an orphan scan, a device send a ``orphan notification command`` to a given list of channels. If a coordinator receives this notification, it responds to the device with a ``coordinator realignment command``. In active and passive scans, the link quality indicator (LQI) is the main parameter used to determine the optimal coordinator. LQI values range from 0 to 255. Where 255 is the highest quality link value and 0 the lowest. Typically, a link lower than 127 is considered a link with poor quality. @@ -315,7 +315,7 @@ running on both, slotted and unslotted mode (CSMA/CA) of 802.15.4 operation for - The standard describes the support of multiple PHY band-modulations but currently, only 250kbps O-QPSK (channel page 0) is supported. - Active and passive MAC scans are able to obtain a LQI value from a beacon frame, however, the scan primitives assumes LQI is correctly implemented and does not check the validity of its value. - Configuration of the ED thresholds are currently not supported. -- Orphan scans are not supported. +- Coordinator realignment command is only supported in orphan scans. - Disassociation primitives are not supported. - Security is not supported. - Beacon enabled mode GTS are not supported. @@ -324,8 +324,10 @@ References ========== * Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs), IEEE Computer Society, IEEE Std 802.15.4-2006, 8 September 2006. +* IEEE Standard for Local and metropolitan area networks--Part 15.4: Low-Rate Wireless Personal Area Networks (LR-WPANs)," in IEEE Std 802.15.4-2011 (Revision of IEEE Std 802.15.4-2006) , vol., no., pp.1-314, 5 Sept. 2011, doi: 10.1109/IEEESTD.2011.6012487. * J. Zheng and Myung J. Lee, "A comprehensive performance study of IEEE 802.15.4," Sensor Network Operations, IEEE Press, Wiley Interscience, Chapter 4, pp. 218-237, 2006. * Alberto Gallegos Ramonet and Taku Noguchi. 2020. LR-WPAN: Beacon Enabled Direct Transmissions on Ns-3. In 2020 the 6th International Conference on Communication and Information Processing (ICCIP 2020). Association for Computing Machinery, New York, NY, USA, 115–122. https://doi.org/10.1145/3442555.3442574. +* Gallegos Ramonet, A.; Noguchi, T. Performance Analysis of IEEE 802.15.4 Bootstrap Process. Electronics 2022, 11, 4090. https://doi.org/10.3390/electronics11244090. Usage ***** @@ -362,6 +364,7 @@ The following examples have been written, which can be found in ``src/lr-wpan/ex * ``lr-wpan-active-scan.cc``: A simple example showing the use of an active scan in the MAC. * ``lr-wpan-mlme.cc``: Demonstrates the use of lr-wpan beacon mode. Nodes use a manual association (i.e. No bootstrap) in this example. * ``lr-wpan-bootstrap.cc``: Demonstrates the use of scanning and association working together to initiate a PAN. +* ``lr-wpan-orphan-scan.cc``: Demonstrates the use of an orphan scanning in a simple network joining procedure. In particular, the module enables a very simplified end-to-end data diff --git a/src/lr-wpan/examples/CMakeLists.txt b/src/lr-wpan/examples/CMakeLists.txt index c23e715e9..9122f66af 100644 --- a/src/lr-wpan/examples/CMakeLists.txt +++ b/src/lr-wpan/examples/CMakeLists.txt @@ -5,6 +5,7 @@ set(base_examples lr-wpan-phy-test lr-wpan-ed-scan lr-wpan-active-scan + lr-wpan-orphan-scan ) foreach( diff --git a/src/lr-wpan/examples/lr-wpan-orphan-scan.cc b/src/lr-wpan/examples/lr-wpan-orphan-scan.cc new file mode 100644 index 000000000..a094df01a --- /dev/null +++ b/src/lr-wpan/examples/lr-wpan-orphan-scan.cc @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2023 Tokushima University, Japan. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Alberto Gallegos Ramonet + */ + +/* + * [00:00:00:00:00:00:00:01 | 00:01] [00:00:00:00:00:00:00:02 | ff:ff] + * PAN Coordinator 1 (PAN: 5) End Device + * |---------------------100m-----------------------| + * Channel 12 (Orphan Scan channels 11-14) + * + * + * This example demonstrate the usage of the MAC MLME-SCAN.request (ORPHAN scan) primitive as + * described by IEEE 802.15.4-2011 (See Figures 14 and 15). + * + * Orphan scan is used typically on devices as a result of repeated communication failures + * (For example, lossing too many ACK). An orphan scan represents the attempt of a device to + * relocate its coordinator. In some situations, it can be used by devices higher layers to not only + * rejoin a network but also join a network for the first time (Like in the joining through + * orphaning mechanism described in Zigbee networks). + * + * In this example, the end device is set to scan 4 channels (11~14) for a period of + * macResponseWaitTime until it finally gets in contact with the coordinator. + * On contact, the coordinator responds to the device (via coordinator realignment command) + * an assign it a short address. The detailed sequence of events is as following: + * + * 1) [Time 2s] The coordinator start a network in channel 12. + * 2) [Time 3s] The end device start orphan scan and transmits a orphan + * notification cmd on channel 11. + * 3) No response is received in channel 11, therefore, the device ends scanning on + * channel 11 after macResponseWaitTime and repeats step 2 in channel 12. + * 4) [Time 3.00269s] The orphan notification command is received by the coordinator in + * channel 12. The coordinator verify the requesting device and replies to the device + * with a coordinator realignment command containing the assigned short address [DE:AF]. + * 5) [Time 3.00646s] The device receives the coordinator realignment command, update its + * macPanId, macShortAddress, macCoordShortAddress and macCoordExtAddress. + * 6) Scanning of the remaining channels 13 and 14 is cancelled. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ns3; + +static void +ScanConfirm(Ptr device, MlmeScanConfirmParams params) +{ + if (params.m_status == MLMESCAN_SUCCESS) + { + std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " [" + << device->GetMac()->GetShortAddress() << " | " + << device->GetMac()->GetExtendedAddress() + << "] MLME-SCAN.confirm: Active scan status SUCCESSFUL " + << "(Coordinator found and address assigned) \n"; + } + else if (params.m_status == MLMESCAN_NO_BEACON) + { + std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " [" + << device->GetMac()->GetShortAddress() << " | " + << device->GetMac()->GetExtendedAddress() + << "] MLME-SCAN.confirm: Could not locate coordinator " + << "(Coord realignment command not received) " + << "status: " << params.m_status << "\n"; + } + else + { + std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " [" + << device->GetMac()->GetShortAddress() << " | " + << device->GetMac()->GetExtendedAddress() + << "] MLME-SCAN.confirm: An error occurred during scanning, " + << "status: " << params.m_status << "\n"; + } +} + +static void +OrphanIndication(Ptr device, MlmeOrphanIndicationParams params) +{ + // The steps taken by the coordinator on the event of an orphan indication + // are meant to be implemented by the next higher layer and are out of the scope of the + // standard. In this example, we simply accept the request , assign a fixed short address + // [DE:AF] and respond to the requesting device using a MLME-ORPHAN.response. + + std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " [" + << device->GetMac()->GetShortAddress() << " | " + << device->GetMac()->GetExtendedAddress() + << "] MLME-ORPHAN.indication: Orphan Notification received, processing...\n"; + + MlmeOrphanResponseParams respParams; + respParams.m_assocMember = true; + respParams.m_orphanAddr = params.m_orphanAddr; + respParams.m_shortAddr = Mac16Address("DE:AF"); + + Simulator::ScheduleNow(&LrWpanMac::MlmeOrphanResponse, device->GetMac(), respParams); +} + +int +main(int argc, char* argv[]) +{ + LogComponentEnableAll(LogLevel(LOG_PREFIX_TIME | LOG_PREFIX_FUNC)); + + // Create 2 PAN coordinator nodes, and 1 end device + Ptr coord1 = CreateObject(); + Ptr endNode = CreateObject(); + + Ptr coord1NetDevice = CreateObject(); + Ptr endNodeNetDevice = CreateObject(); + + // PAN Coordinators configurations require to set both, the EUI-64 (extended address) + // and to assign their own short address. + coord1NetDevice->GetMac()->SetExtendedAddress(Mac64Address("00:00:00:00:00:00:00:01")); + coord1NetDevice->GetMac()->SetShortAddress(Mac16Address("00:01")); + + // Other devices must have only its EUI-64 and later on, their short address is + // potentially assigned by the coordinator. + endNodeNetDevice->GetMac()->SetExtendedAddress(Mac64Address("00:00:00:00:00:00:00:02")); + + // Configure Spectrum channel + Ptr channel = CreateObject(); + Ptr propModel = + CreateObject(); + Ptr delayModel = + CreateObject(); + channel->AddPropagationLossModel(propModel); + channel->SetPropagationDelayModel(delayModel); + + coord1NetDevice->SetChannel(channel); + endNodeNetDevice->SetChannel(channel); + + coord1->AddDevice(coord1NetDevice); + endNode->AddDevice(endNodeNetDevice); + + // Mobility + Ptr coord1Mobility = + CreateObject(); + coord1Mobility->SetPosition(Vector(0, 0, 0)); + coord1NetDevice->GetPhy()->SetMobility(coord1Mobility); + + Ptr endNodeMobility = + CreateObject(); + endNodeMobility->SetPosition(Vector(100, 0, 0)); + endNodeNetDevice->GetPhy()->SetMobility(endNodeMobility); + + // MAC layer Callbacks hooks + endNodeNetDevice->GetMac()->SetMlmeScanConfirmCallback( + MakeBoundCallback(&ScanConfirm, endNodeNetDevice)); + + coord1NetDevice->GetMac()->SetMlmeOrphanIndicationCallback( + MakeBoundCallback(&OrphanIndication, coord1NetDevice)); + + ///////////////// + // ORPHAN SCAN // + ///////////////// + + // PAN coordinator N0 (PAN 5) is set to channel 12 in non-beacon mode + // but answer to beacon request and orphan notification commands. + MlmeStartRequestParams params; + params.m_panCoor = true; + params.m_PanId = 5; + params.m_bcnOrd = 15; + params.m_sfrmOrd = 15; + params.m_logCh = 12; + Simulator::ScheduleWithContext(1, + Seconds(2.0), + &LrWpanMac::MlmeStartRequest, + coord1NetDevice->GetMac(), + params); + + // End device N1 is set to scan 4 channels looking for the presence of a coordinator. + // On each channel, a single orphan notification command is sent and a response is + // waited for a maximum time of macResponseWaitTime. If a reply is received from a + // coordinator within this time (coordinator realignment command), the programmed scans on + // other channels is suspended. + // Scan Channels are represented by bits 0-26 (27 LSB) + // ch 14 ch 11 + // | | + // 0x7800 = 0000000000000000111100000000000 + MlmeScanRequestParams scanParams; + scanParams.m_chPage = 0; + scanParams.m_scanChannels = 0x7800; + scanParams.m_scanType = MLMESCAN_ORPHAN; + Simulator::ScheduleWithContext(1, + Seconds(3.0), + &LrWpanMac::MlmeScanRequest, + endNodeNetDevice->GetMac(), + scanParams); + + Simulator::Stop(Seconds(2000)); + Simulator::Run(); + + Simulator::Destroy(); + return 0; +} diff --git a/src/lr-wpan/model/lr-wpan-csmaca.cc b/src/lr-wpan/model/lr-wpan-csmaca.cc index 7e3863b58..9975a9613 100644 --- a/src/lr-wpan/model/lr-wpan-csmaca.cc +++ b/src/lr-wpan/model/lr-wpan-csmaca.cc @@ -31,7 +31,9 @@ #include #undef NS_LOG_APPEND_CONTEXT -#define NS_LOG_APPEND_CONTEXT std::clog << "[address " << m_mac->GetShortAddress() << "] "; +#define NS_LOG_APPEND_CONTEXT \ + std::clog << "[address " << m_mac->GetShortAddress() << " | " << m_mac->GetExtendedAddress() \ + << "] "; namespace ns3 { diff --git a/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc b/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc index b6e6bfdb5..bc24c3c64 100644 --- a/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc +++ b/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc @@ -182,6 +182,7 @@ CommandPayloadHeader::GetSerializedSize() const case BEACON_REQ: break; case COOR_REALIGN: + size += 8; break; case GTS_REQ: break; @@ -217,6 +218,11 @@ CommandPayloadHeader::Serialize(Buffer::Iterator start) const case BEACON_REQ: break; case COOR_REALIGN: + i.WriteU16(m_panid); + WriteTo(i, m_coordShortAddr); + i.WriteU8(m_logCh); + WriteTo(i, m_shortAddr); + i.WriteU8(m_logChPage); break; case GTS_REQ: break; @@ -251,6 +257,11 @@ CommandPayloadHeader::Deserialize(Buffer::Iterator start) case BEACON_REQ: break; case COOR_REALIGN: + m_panid = i.ReadU16(); + ReadFrom(i, m_coordShortAddr); + m_logCh = i.ReadU8(); + ReadFrom(i, m_shortAddr); + m_logChPage = i.ReadU8(); break; case GTS_REQ: break; @@ -264,7 +275,7 @@ CommandPayloadHeader::Deserialize(Buffer::Iterator start) void CommandPayloadHeader::Print(std::ostream& os) const { - os << "| MAC Command Frame ID | = " << (uint32_t)m_cmdFrameId; + os << "| MAC Command Frame ID | = " << static_cast(m_cmdFrameId); switch (m_cmdFrameId) { case ASSOCIATION_REQ: @@ -289,6 +300,11 @@ CommandPayloadHeader::Print(std::ostream& os) const case BEACON_REQ: break; case COOR_REALIGN: + os << "| PAN identifier| = " << m_panid + << "| PAN Coord Short address| = " << m_coordShortAddr + << "| Channel Num.| = " << static_cast(m_logCh) + << "| Short address| = " << m_shortAddr + << "| Page Num.| = " << static_cast(m_logChPage); break; case GTS_REQ: break; @@ -310,6 +326,34 @@ CommandPayloadHeader::SetCapabilityField(CapabilityField cap) m_capabilityInfo = cap; } +void +CommandPayloadHeader::SetCoordShortAddr(Mac16Address addr) +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + m_coordShortAddr = addr; +} + +void +CommandPayloadHeader::SetChannel(uint8_t channel) +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + m_logCh = channel; +} + +void +CommandPayloadHeader::SetPage(uint8_t page) +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + m_logChPage = page; +} + +void +CommandPayloadHeader::SetPanId(uint16_t id) +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + m_panid = id; +} + CommandPayloadHeader::MacCommand CommandPayloadHeader::GetCommandFrameType() const { @@ -350,7 +394,7 @@ CommandPayloadHeader::GetCommandFrameType() const void CommandPayloadHeader::SetShortAddr(Mac16Address shortAddr) { - NS_ASSERT(m_cmdFrameId == ASSOCIATION_RESP); + NS_ASSERT(m_cmdFrameId == ASSOCIATION_RESP || m_cmdFrameId == COOR_REALIGN); m_shortAddr = shortAddr; } @@ -364,7 +408,6 @@ CommandPayloadHeader::SetAssociationStatus(AssocStatus status) Mac16Address CommandPayloadHeader::GetShortAddr() const { - NS_ASSERT(m_cmdFrameId == ASSOCIATION_RESP); return m_shortAddr; } @@ -382,4 +425,32 @@ CommandPayloadHeader::GetCapabilityField() const return m_capabilityInfo; } +Mac16Address +CommandPayloadHeader::GetCoordShortAddr() const +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + return m_coordShortAddr; +} + +uint8_t +CommandPayloadHeader::GetChannel() const +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + return m_logCh; +} + +uint8_t +CommandPayloadHeader::GetPage() const +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + return m_logChPage; +} + +uint16_t +CommandPayloadHeader::GetPanId() const +{ + NS_ASSERT(m_cmdFrameId == COOR_REALIGN); + return m_panid; +} + } // namespace ns3 diff --git a/src/lr-wpan/model/lr-wpan-mac-pl-headers.h b/src/lr-wpan/model/lr-wpan-mac-pl-headers.h index d426ca95b..fbb1df272 100644 --- a/src/lr-wpan/model/lr-wpan-mac-pl-headers.h +++ b/src/lr-wpan/model/lr-wpan-mac-pl-headers.h @@ -98,6 +98,9 @@ class BeaconPayloadHeader : public Header * \ingroup lr-wpan * Implements the header for the MAC payload command frame according to * the IEEE 802.15.4-2011 Std. + * - Association Response Command (See 5.3.2.2.) + * - Coordinator Realigment Command (See 5.3.8.) + * - Association Request Command (See 5.3.1.) */ class CommandPayloadHeader : public Header { @@ -160,7 +163,28 @@ class CommandPayloadHeader : public Header */ void SetCapabilityField(CapabilityField cap); /** - * Set the Short Address Assigned by the coordinator (Association Response Command). + * Set the coordinator short address (16 bit address). + * \param addr The coordinator short address. + */ + void SetCoordShortAddr(Mac16Address addr); + /** + * Set the logical channel number. + * \param channel The channel number. + */ + void SetChannel(uint8_t channel); + /** + * Set the logical channel page number. + * \param page The page number. + */ + void SetPage(uint8_t page); + /** + * Get the PAN identifier. + * \param id The PAN identifier. + */ + void SetPanId(uint16_t id); + /** + * Set the Short Address Assigned by the coordinator + * (Association Response and Coordinator Realigment Commands). * \param shortAddr The short address assigned by the coordinator */ void SetShortAddr(Mac16Address shortAddr); @@ -170,7 +194,8 @@ class CommandPayloadHeader : public Header */ void SetAssociationStatus(AssocStatus status); /** - * Get the Short address assigned by the coordinator (Association Response Command). + * Get the Short address assigned by the coordinator + * (Association Response and Coordinator Realigment commands). * \return The Mac16Address assigned by the coordinator */ Mac16Address GetShortAddr() const; @@ -185,19 +210,44 @@ class CommandPayloadHeader : public Header */ MacCommand GetCommandFrameType() const; /** - * Get the Capability Information Field from the command payload header. (Association Request - * Command) + * Get the Capability Information Field from the command payload header. + * (Association Request Command) * \return The Capability Information Field */ CapabilityField GetCapabilityField() const; + /** + * Get the coordinator short address. + * \return The coordinator short address (16 bit address) + */ + Mac16Address GetCoordShortAddr() const; + /** + * Get the logical channel number. + * \return The channel number + */ + uint8_t GetChannel() const; + /** + * Get the logical channel page number. + * \return The page number. + */ + uint8_t GetPage() const; + /** + * Get the PAN identifier. + * \return The PAN Identifier + */ + uint16_t GetPanId() const; private: - MacCommand m_cmdFrameId; //!< The command Frame Identifier - CapabilityField - m_capabilityInfo; //!< Capability Information Field (Association Request Command) - Mac16Address m_shortAddr; //!< Contains the short address assigned by the coordinator - //!< (Association Response Command) See IEEE 802.15.4-2011 5.3.2.2. - AssocStatus m_assocStatus; //!< Association Status (Association Response Command) + MacCommand m_cmdFrameId; //!< The command Frame Identifier (Used by all commands) + CapabilityField m_capabilityInfo; //!< Capability Information Field + //!< (Association Request Command) + Mac16Address m_shortAddr; //!< Contains the short address assigned by the coordinator + //!< (Association Response and Coordinator Realiagment Command) + Mac16Address m_coordShortAddr; //!< The coordinator short address + //!< (Coordinator realigment command) + uint16_t m_panid; //!< The PAN identifier (Coordinator realigment command) + uint8_t m_logCh; //!< The channel number (Coordinator realigment command) + uint8_t m_logChPage; //!< The channel page number (Coordinator realigment command) + AssocStatus m_assocStatus; //!< Association Status (Association Response Command) }; } // namespace ns3 diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 79f8736ec..95653b64e 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -39,7 +39,8 @@ #include #undef NS_LOG_APPEND_CONTEXT -#define NS_LOG_APPEND_CONTEXT std::clog << "[address " << m_shortAddress << "] "; +#define NS_LOG_APPEND_CONTEXT \ + std::clog << "[address " << m_shortAddress << " | " << m_selfExt << "] "; namespace ns3 { @@ -276,7 +277,15 @@ LrWpanMac::DoDispose() m_mlmeAssociateConfirmCallback = MakeNullCallback(); m_mlmeAssociateIndicationCallback = MakeNullCallback(); m_mlmeCommStatusIndicationCallback = MakeNullCallback(); + m_mlmeOrphanIndicationCallback = MakeNullCallback(); + m_panDescriptorList.clear(); + m_energyDetectList.clear(); + m_unscannedChannels.clear(); + + m_scanEvent.Cancel(); + m_scanEnergyEvent.Cancel(); + m_scanOrphanEvent.Cancel(); m_beaconEvent.Cancel(); Object::DoDispose(); @@ -495,7 +504,7 @@ LrWpanMac::McpsDataRequest(McpsDataRequestParams params, Ptr p) p->AddHeader(macHdr); LrWpanMacTrailer macTrailer; - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -520,7 +529,7 @@ LrWpanMac::McpsDataRequest(McpsDataRequestParams params, Ptr p) p->AddHeader(macHdr); LrWpanMacTrailer macTrailer; - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -584,7 +593,7 @@ LrWpanMac::MlmeScanRequest(MlmeScanRequestParams params) confirmParams.m_scanType = params.m_scanType; confirmParams.m_chPage = params.m_chPage; - if (m_scanEvent.IsRunning() || m_scanEnergyEvent.IsRunning()) + if ((m_scanEvent.IsRunning() || m_scanEnergyEvent.IsRunning()) || m_scanOrphanEvent.IsRunning()) { if (!m_mlmeScanConfirmCallback.IsNull()) { @@ -595,7 +604,7 @@ LrWpanMac::MlmeScanRequest(MlmeScanRequestParams params) return; } - if (params.m_scanDuration > 14 || params.m_scanType > MLMESCAN_PASSIVE) + if (params.m_scanDuration > 14 || params.m_scanType > MLMESCAN_ORPHAN) { if (!m_mlmeScanConfirmCallback.IsNull()) { @@ -611,6 +620,7 @@ LrWpanMac::MlmeScanRequest(MlmeScanRequestParams params) m_panDescriptorList.clear(); m_energyDetectList.clear(); + m_unscannedChannels.clear(); // TODO: stop beacon transmission @@ -758,7 +768,7 @@ LrWpanMac::MlmeAssociateResponse(MlmeAssociateResponseParams params) commandPacket->AddHeader(macPayload); commandPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -771,6 +781,66 @@ LrWpanMac::MlmeAssociateResponse(MlmeAssociateResponseParams params) EnqueueInd(commandPacket); } +void +LrWpanMac::MlmeOrphanResponse(MlmeOrphanResponseParams params) +{ + NS_LOG_FUNCTION(this); + // Mac header Coordinator realigment Command + // See 802.15.4-2011 (Section 6.2.7.2) + LrWpanMacHeader macHdr(LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_macDsn.GetValue()); + m_macDsn++; + LrWpanMacTrailer macTrailer; + Ptr commandPacket = Create(); + macHdr.SetPanIdComp(); + macHdr.SetDstAddrMode(LrWpanMacHeader::EXTADDR); + macHdr.SetDstAddrFields(0xffff, params.m_orphanAddr); + + macHdr.SetSrcAddrMode(LrWpanMacHeader::EXTADDR); + macHdr.SetSrcAddrFields(m_macPanId, GetExtendedAddress()); + macHdr.SetSrcAddrFields(m_macPanId, Mac16Address("FF:FF")); + + macHdr.SetFrameVer(0x01); + macHdr.SetSecDisable(); + macHdr.SetAckReq(); + + CommandPayloadHeader macPayload(CommandPayloadHeader::COOR_REALIGN); + macPayload.SetPanId(m_macPanId); + macPayload.SetCoordShortAddr(GetShortAddress()); + macPayload.SetChannel(m_phy->GetCurrentChannelNum()); + macPayload.SetPage(m_phy->GetCurrentPage()); + + if (params.m_assocMember) + { + // The orphan device was associated with the coordinator + + // Either FF:FE for extended address mode + // or the short address assigned by the coord. + macPayload.SetShortAddr(params.m_shortAddr); + } + else + { + // The orphan device was NOT associated with the coordinator + macPayload.SetShortAddr(Mac16Address("FF:FF")); + } + + commandPacket->AddHeader(macPayload); + commandPacket->AddHeader(macHdr); + + // Calculate FCS if the global attribute ChecksumEnabled is set. + if (Node::ChecksumEnabled()) + { + macTrailer.EnableFcs(true); + macTrailer.SetFcs(commandPacket); + } + + commandPacket->AddTrailer(macTrailer); + + Ptr txQElement = Create(); + txQElement->txQPkt = commandPacket; + EnqueueTxQElement(txQElement); + CheckQueue(); +} + void LrWpanMac::MlmeSyncRequest(MlmeSyncRequestParams params) { @@ -906,7 +976,7 @@ LrWpanMac::SendOneBeacon() beaconPacket->AddHeader(macPayload); beaconPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -944,8 +1014,8 @@ LrWpanMac::SendBeaconRequestCommand() macHdr.SetDstAddrMode(LrWpanMacHeader::SHORTADDR); macHdr.SetSrcAddrMode(LrWpanMacHeader::NOADDR); - macHdr.SetDstAddrFields(0xFFFF, - Mac16Address("FF:FF")); // Not associated PAN, broadcast dst address + // Not associated PAN, broadcast dst address + macHdr.SetDstAddrFields(0xFFFF, Mac16Address("FF:FF")); macHdr.SetSecDisable(); macHdr.SetNoAckReq(); @@ -956,7 +1026,48 @@ LrWpanMac::SendBeaconRequestCommand() commandPacket->AddHeader(macPayload); commandPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. + if (Node::ChecksumEnabled()) + { + macTrailer.EnableFcs(true); + macTrailer.SetFcs(commandPacket); + } + + commandPacket->AddTrailer(macTrailer); + + Ptr txQElement = Create(); + txQElement->txQPkt = commandPacket; + EnqueueTxQElement(txQElement); + CheckQueue(); +} + +void +LrWpanMac::SendOrphanNotificationCommand() +{ + LrWpanMacHeader macHdr(LrWpanMacHeader::LRWPAN_MAC_COMMAND, m_macDsn.GetValue()); + m_macDsn++; + LrWpanMacTrailer macTrailer; + Ptr commandPacket = Create(); + + // See IEEE 802.15.4-2011 (5.3.6) + macHdr.SetPanIdComp(); + + macHdr.SetSrcAddrMode(LrWpanMacHeader::EXTADDR); + macHdr.SetSrcAddrFields(0xFFFF, GetExtendedAddress()); + + macHdr.SetDstAddrMode(LrWpanMacHeader::SHORTADDR); + macHdr.SetDstAddrFields(0xFFFF, Mac16Address("FF:FF")); + + macHdr.SetSecDisable(); + macHdr.SetNoAckReq(); + + CommandPayloadHeader macPayload; + macPayload.SetCommandFrameType(CommandPayloadHeader::ORPHAN_NOTIF); + + commandPacket->AddHeader(macPayload); + commandPacket->AddHeader(macHdr); + + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -1005,7 +1116,7 @@ LrWpanMac::SendAssocRequestCommand() commandPacket->AddHeader(macPayload); commandPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -1063,7 +1174,7 @@ LrWpanMac::SendDataRequestCommand() commandPacket->AddHeader(macPayload); commandPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -1160,6 +1271,7 @@ LrWpanMac::EndStartRequest() m_incCfpEvent.Cancel(); m_trackingEvent.Cancel(); m_scanEvent.Cancel(); + m_scanOrphanEvent.Cancel(); m_scanEnergyEvent.Cancel(); m_csmaCa->SetUnSlottedCsmaCa(); @@ -1227,21 +1339,59 @@ LrWpanMac::EndChannelScan() } else { - // All scans on the channel list completed - // Return to the MAC values previous to start of the first scan. + // All channels in the list scan completed. + // Return variables to the values before the scan and return the status to the next layer. m_macPanId = m_macPanIdScan; m_macPanIdScan = 0; // TODO: restart beacon transmissions that were active before the beginning of the scan // (i.e when a coordinator perform a scan and it was already transmitting beacons) - - // All channels scanned, report success MlmeScanConfirmParams confirmParams; - confirmParams.m_status = MLMESCAN_SUCCESS; confirmParams.m_chPage = m_scanParams.m_chPage; confirmParams.m_scanType = m_scanParams.m_scanType; confirmParams.m_energyDetList = {}; - confirmParams.m_panDescList = m_panDescriptorList; + confirmParams.m_unscannedCh = m_unscannedChannels; + confirmParams.m_resultListSize = m_panDescriptorList.size(); + + // See IEEE 802.15.4-2011, Table 31 (panDescriptorList value on macAutoRequest) + // and Section 6.2.10.2 + switch (confirmParams.m_scanType) + { + case MLMESCAN_PASSIVE: + if (m_macAutoRequest) + { + confirmParams.m_panDescList = m_panDescriptorList; + } + confirmParams.m_status = MLMESCAN_SUCCESS; + break; + case MLMESCAN_ACTIVE: + if (m_panDescriptorList.empty()) + { + confirmParams.m_status = MLMESCAN_NO_BEACON; + } + else + { + if (m_macAutoRequest) + { + confirmParams.m_panDescList = m_panDescriptorList; + } + confirmParams.m_status = MLMESCAN_SUCCESS; + } + break; + case MLMESCAN_ORPHAN: + confirmParams.m_panDescList = {}; + confirmParams.m_status = MLMESCAN_NO_BEACON; + confirmParams.m_resultListSize = 0; + // The device lost track of the coordinator and was unable + // to locate it, disassociate from the network. + m_macPanId = 0xffff; + m_shortAddress = Mac16Address("FF:FF"); + m_macCoordShortAddress = Mac16Address("ff:ff"); + m_macCoordExtendedAddress = Mac64Address("ff:ff:ff:ff:ff:ff:ff:ed"); + break; + default: + NS_LOG_ERROR(this << " Invalid scan type"); + } if (!m_mlmeScanConfirmCallback.IsNull()) { @@ -1259,7 +1409,7 @@ LrWpanMac::EndChannelEnergyScan() { NS_LOG_FUNCTION(this); // Add the results of channel energy scan to the detectList - m_energyDetectList.push_back(m_maxEnergyLevel); + m_energyDetectList.emplace_back(m_maxEnergyLevel); m_maxEnergyLevel = 0; m_channelScanIndex++; @@ -1300,6 +1450,7 @@ LrWpanMac::EndChannelEnergyScan() confirmParams.m_chPage = m_phy->GetCurrentPage(); confirmParams.m_scanType = m_scanParams.m_scanType; confirmParams.m_energyDetList = m_energyDetectList; + confirmParams.m_resultListSize = m_energyDetectList.size(); m_mlmeScanConfirmCallback(confirmParams); } m_pendPrimitive = MLME_NONE; @@ -1596,6 +1747,12 @@ LrWpanMac::SetMlmeCommStatusIndicationCallback(MlmeCommStatusIndicationCallback m_mlmeCommStatusIndicationCallback = c; } +void +LrWpanMac::SetMlmeOrphanIndicationCallback(MlmeOrphanIndicationCallback c) +{ + m_mlmeOrphanIndicationCallback = c; +} + void LrWpanMac::SetMcpsDataConfirmCallback(McpsDataConfirmCallback c) { @@ -1805,15 +1962,23 @@ LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) acceptFrame = (receivedMacHdr.GetExtDstAddr() == m_selfExt); } - // When PASSIVE or ACTIVE scan is running, reject any frames other than BEACON frames - if (acceptFrame && (!receivedMacHdr.IsBeacon() && m_scanEvent.IsRunning())) + if (acceptFrame && m_scanEvent.IsRunning()) { - acceptFrame = false; + if (!receivedMacHdr.IsBeacon()) + { + acceptFrame = false; + } } - - // Energy Scan is running, reject any frames - if (m_scanEnergyEvent.IsRunning()) + else if (acceptFrame && m_scanOrphanEvent.IsRunning()) { + if (!receivedMacHdr.IsCommand()) + { + acceptFrame = false; + } + } + else if (m_scanEnergyEvent.IsRunning()) + { + // Reject any frames if energy scan is running acceptFrame = false; } @@ -2073,7 +2238,7 @@ LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) if (!descriptorExists) { - m_panDescriptorList.push_back(panDescriptor); + m_panDescriptorList.emplace_back(panDescriptor); } return; } @@ -2130,13 +2295,14 @@ LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) } else if (receivedMacHdr.IsCommand()) { - // Handle the reception of frame commands that do not require ACK (i.e. Beacon - // Request Command) + // Handle the reception of frame commands that do not require ACK + // (i.e. Beacon Request, Orphan notification, Coordinator Realigment) CommandPayloadHeader receivedMacPayload; p->PeekHeader(receivedMacPayload); - if (receivedMacPayload.GetCommandFrameType() == - CommandPayloadHeader::BEACON_REQ) + + switch (receivedMacPayload.GetCommandFrameType()) { + case CommandPayloadHeader::BEACON_REQ: // TODO: check that node is any coordinator not just pan coordinator if (m_csmaCa->IsUnSlottedCsmaCa() && m_panCoor) { @@ -2146,6 +2312,48 @@ LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) { m_macRxDropTrace(originalPkt); } + break; + case CommandPayloadHeader::ORPHAN_NOTIF: + if (!m_mlmeOrphanIndicationCallback.IsNull()) + { + MlmeOrphanIndicationParams orphanParams; + orphanParams.m_orphanAddr = receivedMacHdr.GetExtSrcAddr(); + m_mlmeOrphanIndicationCallback(orphanParams); + } + break; + case CommandPayloadHeader::COOR_REALIGN: + if (m_scanOrphanEvent.IsRunning()) + { + // Coordinator located, no need to keep scanning other channels + m_scanOrphanEvent.Cancel(); + + m_macPanIdScan = 0; + m_pendPrimitive = MLME_NONE; + m_channelScanIndex = 0; + + // Update the device information with the received information + // from the Coordinator Realigment command. + m_macPanId = receivedMacPayload.GetPanId(); + m_shortAddress = receivedMacPayload.GetShortAddr(); + m_macCoordExtendedAddress = receivedMacHdr.GetExtSrcAddr(); + m_macCoordShortAddress = receivedMacPayload.GetCoordShortAddr(); + + if (!m_mlmeScanConfirmCallback.IsNull()) + { + MlmeScanConfirmParams confirmParams; + confirmParams.m_scanType = m_scanParams.m_scanType; + confirmParams.m_chPage = m_scanParams.m_chPage; + confirmParams.m_status = MLMESCAN_SUCCESS; + m_mlmeScanConfirmCallback(confirmParams); + } + m_scanParams = {}; + } + // TODO: handle Coordinator realignment when not + // used during an orphan scan. + break; + default: + m_macRxDropTrace(originalPkt); + break; } } else if (receivedMacHdr.IsData() && !m_mcpsDataIndicationCallback.IsNull()) @@ -2316,7 +2524,7 @@ LrWpanMac::SendAck(uint8_t seqno) LrWpanMacTrailer macTrailer; Ptr ackPacket = Create(0); ackPacket->AddHeader(macHdr); - // Calculate FCS if the global attribute ChecksumEnable is set. + // Calculate FCS if the global attribute ChecksumEnabled is set. if (Node::ChecksumEnabled()) { macTrailer.EnableFcs(true); @@ -2834,8 +3042,38 @@ LrWpanMac::PdDataConfirm(LrWpanPhyEnumeration status) } else if (macHdr.IsCommand()) { - // We handle commands that do not require ACK (e.g. BeaconReq command) - // other command are handle by the previous if statement. + // We handle commands that do not require ACK + // (e.g. Coordinator realigment command in an orphan response) + // Other command with ACK required are handle by the previous if statement. + + // Check the transmitted packet command type and issue the appropriate indication. + Ptr txOriginalPkt = m_txPkt->Copy(); + LrWpanMacHeader txMacHdr; + txOriginalPkt->RemoveHeader(txMacHdr); + CommandPayloadHeader txMacPayload; + txOriginalPkt->RemoveHeader(txMacPayload); + + if (txMacPayload.GetCommandFrameType() == CommandPayloadHeader::COOR_REALIGN) + { + if (!m_mlmeCommStatusIndicationCallback.IsNull()) + { + MlmeCommStatusIndicationParams commStatusParams; + commStatusParams.m_panId = m_macPanId; + + commStatusParams.m_srcAddrMode = macHdr.GetSrcAddrMode(); + commStatusParams.m_srcExtAddr = macHdr.GetExtSrcAddr(); + commStatusParams.m_srcShortAddr = macHdr.GetShortSrcAddr(); + + commStatusParams.m_dstAddrMode = macHdr.GetDstAddrMode(); + commStatusParams.m_dstExtAddr = macHdr.GetExtDstAddr(); + commStatusParams.m_dstShortAddr = macHdr.GetShortDstAddr(); + + commStatusParams.m_status = LrWpanMlmeCommStatus::MLMECOMMSTATUS_SUCCESS; + m_mlmeCommStatusIndicationCallback(commStatusParams); + } + } + + ifsWaitTime = Seconds(static_cast(GetIfsSize()) / symbolRate); RemoveFirstTxQElement(); } else @@ -3115,9 +3353,19 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu if (status == LrWpanPhyEnumeration::IEEE_802_15_4_PHY_SUCCESS) { uint64_t symbolRate = static_cast(m_phy->GetDataOrSymbolRate(false)); - uint64_t scanDuration = lrwpan::aBaseSuperframeDuration * - ((static_cast(1 << m_scanParams.m_scanDuration)) + 1); - Time nextScanTime = Seconds(static_cast(scanDuration / symbolRate)); + Time nextScanTime; + + if (m_scanParams.m_scanType == MLMESCAN_ORPHAN) + { + nextScanTime = Seconds(static_cast(m_macResponseWaitTime) / symbolRate); + } + else + { + uint64_t scanDuration = + lrwpan::aBaseSuperframeDuration * + ((static_cast(1 << m_scanParams.m_scanDuration)) + 1); + nextScanTime = Seconds(static_cast(scanDuration / symbolRate)); + } switch (m_scanParams.m_scanType) { @@ -3138,8 +3386,9 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu m_phy->PlmeSetTRXStateRequest(IEEE_802_15_4_PHY_RX_ON); break; case MLMESCAN_ORPHAN: - // TODO: add orphan scan support - NS_LOG_ERROR("Scan Type currently not supported"); + m_scanOrphanEvent = + Simulator::Schedule(nextScanTime, &LrWpanMac::EndChannelScan, this); + SendOrphanNotificationCommand(); break; default: @@ -3378,8 +3627,41 @@ LrWpanMac::SetLrWpanMacState(LrWpanMacState macState) } break; } + case CommandPayloadHeader::COOR_REALIGN: { + if (!m_mlmeCommStatusIndicationCallback.IsNull()) + { + MlmeCommStatusIndicationParams commStatusParams; + commStatusParams.m_panId = m_macPanId; + commStatusParams.m_srcAddrMode = LrWpanMacHeader::EXTADDR; + commStatusParams.m_srcExtAddr = macHdr.GetExtSrcAddr(); + commStatusParams.m_dstAddrMode = LrWpanMacHeader::EXTADDR; + commStatusParams.m_dstExtAddr = macHdr.GetExtDstAddr(); + commStatusParams.m_status = + LrWpanMlmeCommStatus::MLMECOMMSTATUS_CHANNEL_ACCESS_FAILURE; + m_mlmeCommStatusIndicationCallback(commStatusParams); + } + break; + } + case CommandPayloadHeader::ORPHAN_NOTIF: { + if (m_scanOrphanEvent.IsRunning()) + { + m_unscannedChannels.emplace_back(m_phy->GetCurrentChannelNum()); + } + // TODO: Handle orphan notification command during a + // channel access failure when not is not scanning. + break; + } + case CommandPayloadHeader::BEACON_REQ: { + if (m_scanEvent.IsRunning()) + { + m_unscannedChannels.emplace_back(m_phy->GetCurrentChannelNum()); + } + // TODO: Handle beacon request command during a + // channel access failure when not scanning. + break; + } default: { - // TODO: Other commands(e.g. Orphan Request) + // TODO: Other commands(e.g. Disassociation notification, etc) break; } } diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index 29c432488..a1024106f 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -455,11 +455,11 @@ struct MlmeAssociateResponseParams */ struct MlmeStartRequestParams { - uint16_t m_PanId{0}; //!< Pan Identifier used by the device. - uint8_t m_logCh{ - 11}; //!< Logical channel on which to start using the new superframe configuration. - uint32_t m_logChPage{ - 0}; //!< Logical channel page on which to start using the new superframe configuration. + uint16_t m_PanId{0}; //!< Pan Identifier used by the device. + uint8_t m_logCh{11}; //!< Logical channel on which to start using the + //!< new superframe configuration. + uint32_t m_logChPage{0}; //!< Logical channel page on which to start using the + //!< new superframe configuration. uint32_t m_startTime{0}; //!< Time at which to begin transmitting beacons (Used by Coordinator //!< not PAN Coordinators). The time is specified in symbols. uint8_t m_bcnOrd{15}; //!< Beacon Order, Used to calculate the beacon interval, a value of 15 @@ -507,7 +507,9 @@ struct MlmeScanRequestParams { LrWpanMlmeScanType m_scanType{MLMESCAN_PASSIVE}; //!< Indicates the type of scan performed as //!< described in IEEE 802.15.4-2011 (5.1.2.1). - uint32_t m_scanChannels{0x7FFFFFF}; //!< The channel numbers to be scanned. + uint32_t m_scanChannels{0x7FFF800}; //!< The channel numbers to be scanned. + //!< Default: (0x7FFF800 = Ch11-Ch26) + //!< 27 LSB (b0,b1,...,b26) = channels uint8_t m_scanDuration{14}; //!< A value used to calculate the length of time to spend scanning //!< [aBaseSuperframeDuration * (2^m_scanDuration +)]. uint32_t m_chPage{0}; //!< The channel page on which to perform scan. @@ -520,16 +522,17 @@ struct MlmeScanRequestParams */ struct MlmeScanConfirmParams { - LrWpanMlmeScanConfirmStatus m_status{ - MLMESCAN_INVALID_PARAMETER}; //!< The status of the scan request. - LrWpanMlmeScanType m_scanType{ - MLMESCAN_PASSIVE}; //!< Indicates the type of scan performed (ED,ACTIVE,PASSIVE,ORPHAN). - uint32_t m_chPage{0}; //!< The channel page on which the scan was performed. - std::vector m_unscannedCh; //!< A list of channels given in the request which were not - //!< scanned (Not valid for ED scans). - std::vector - m_energyDetList; //!< A list of energy measurements, one for each channel searched during ED - //!< scan (Not valid for Active, Passive or Orphan Scans) + LrWpanMlmeScanConfirmStatus m_status{MLMESCAN_INVALID_PARAMETER}; //!< The status the request. + LrWpanMlmeScanType m_scanType{MLMESCAN_PASSIVE}; //!< Indicates the type of scan + //!< performed (ED,ACTIVE,PASSIVE,ORPHAN). + uint32_t m_chPage{0}; //!< The channel page on which the scan was performed. + std::vector m_unscannedCh; //!< A list of channels given in the request which + //!< were not scanned (Not valid for ED scans). + uint8_t m_resultListSize{0}; //!< The number of elements returned in the appropriate + //!< result list. (Not valid for Orphan scan). + std::vector m_energyDetList; //!< A list of energy measurements, one for each + //!< channel searched during ED scan + //!< (Not valid for Active, Passive or Orphan Scans) std::vector m_panDescList; //!< A list of PAN descriptor, one for each beacon //!< found (Not valid for ED and Orphan scans). }; @@ -620,13 +623,35 @@ struct MlmeCommStatusIndicationParams Mac64Address m_srcExtAddr; //!< The extended address of the entity from which the frame causing //!< the error originated. uint8_t m_dstAddrMode{SHORT_ADDR}; //!< The destination addressing mode for this primitive. - Mac16Address - m_dstShortAddr; //!< The short address of the device for which the frame was intended. - Mac64Address - m_dstExtAddr; //!< The extended address of the device for which the frame was intended. + Mac16Address m_dstShortAddr; //!< The short address of the device for + //!< which the frame was intended. + Mac64Address m_dstExtAddr; //!< The extended address of the device for + //!< which the frame was intended. LrWpanMlmeCommStatus m_status{MLMECOMMSTATUS_INVALID_PARAMETER}; //!< The communication status }; +/** + * \ingroup lr-wpan + * + * MLME-ORPHAN.indication params. See 802.15.4-2011 Section 6.2.7.1 + */ +struct MlmeOrphanIndicationParams +{ + Mac64Address m_orphanAddr; //!< The address of the orphaned device. +}; + +/** + * \ingroup lr-wpan + * + * MLME-ORPHAN.response params. See 802.15.4-2011 Section 6.2.7.2 + */ +struct MlmeOrphanResponseParams +{ + Mac64Address m_orphanAddr; //!< The address of the orphaned device. + Mac16Address m_shortAddr; //!< The short address allocated. + bool m_assocMember{false}; //!< T = allocated with this coord | F = otherwise +}; + /** * \ingroup lr-wpan * @@ -751,6 +776,17 @@ typedef Callback MlmeAssociateIndicationCal */ typedef Callback MlmeCommStatusIndicationCallback; +/** + * \ingroup lr-wpan + * + * This callback is called by the MLME and issued to its next higher layer following + * the reception of a orphan notification. + * + * Security related parameters and not handle. + * See 802.15.4-2011 6.2.7.1 + */ +typedef Callback MlmeOrphanIndicationCallback; + /** * \ingroup lr-wpan * @@ -901,6 +937,16 @@ class LrWpanMac : public Object */ void MlmeAssociateResponse(MlmeAssociateResponseParams params); + /** + * IEEE 802.15.4-2011, section 6.2.7.2 + * MLME-ORPHAN.response + * Primitive used to initiatte a response to an MLME-ORPHAN.indication + * primitive. + * + * \param params the orphan response parameters + */ + void MlmeOrphanResponse(MlmeOrphanResponseParams params); + /** * IEEE 802.15.4-2011, section 6.2.13.1 * MLME-SYNC.request @@ -978,6 +1024,15 @@ class LrWpanMac : public Object */ void SetMlmeCommStatusIndicationCallback(MlmeCommStatusIndicationCallback c); + /** + * Set the callback for the indication to the reception of an orphan notification. + * The callback implements MLME-ORPHAN.indication SAP of IEEE 802.15.4-2011, + * section 6.2.7.1. + * + * \param c the callback + */ + void SetMlmeOrphanIndicationCallback(MlmeOrphanIndicationCallback c); + /** * Set the callback for the confirmation of a data transmission request. * The callback implements MCPS-DATA.confirm SAP of IEEE 802.15.4-2006, @@ -1563,6 +1618,13 @@ class LrWpanMac : public Object */ void SendBeaconRequestCommand(); + /** + * Called to send a orphan notification command. This is used by an associated device that + * has lost synchronization with its coordinator. + * As described in IEEE 802.15.4-2011 (Section 5.3.6) + */ + void SendOrphanNotificationCommand(); + /** * Called to end a MLME-START.request after changing the page and channel number. */ @@ -1960,6 +2022,12 @@ class LrWpanMac : public Object */ MlmeCommStatusIndicationCallback m_mlmeCommStatusIndicationCallback; + /** + * This callback is used to indicate the reception of a orphan notification command. + * See IEEE 802.15.4-2011, section 6.2.7.1 + */ + MlmeOrphanIndicationCallback m_mlmeOrphanIndicationCallback; + /** * This callback is used to report data transmission request status to the * upper layers. @@ -2042,9 +2110,14 @@ class LrWpanMac : public Object */ std::vector m_energyDetectList; + /** + * The list of unscanned channels during a scan operation. + */ + std::vector m_unscannedChannels; + /** * The parameters used during a MLME-SCAN.request. These parameters are stored here while - * PLME-SET operations (set channel page, set channel number) and multiple ed scans take place. + * PLME-SET (set channel page, set channel number) and other operations take place. */ MlmeScanRequestParams m_scanParams; @@ -2139,10 +2212,15 @@ class LrWpanMac : public Object EventId m_trackingEvent; /** - * Scheduler event for the end of a channel scan. + * Scheduler event for the end of an ACTIVE or PASSIVE channel scan. */ EventId m_scanEvent; + /** + * Scheduler event for the end of an ORPHAN channel scan. + */ + EventId m_scanOrphanEvent; + /** * Scheduler event for the end of a ED channel scan. */ diff --git a/src/lr-wpan/test/lr-wpan-mac-test.cc b/src/lr-wpan/test/lr-wpan-mac-test.cc index 6e78d04fd..9f77df6f8 100644 --- a/src/lr-wpan/test/lr-wpan-mac-test.cc +++ b/src/lr-wpan/test/lr-wpan-mac-test.cc @@ -488,27 +488,216 @@ TestActiveScanPanDescriptors::DoRun() NS_TEST_EXPECT_MSG_EQ(m_panDescriptorList.size(), 2, "Error, Beacons not received or PAN descriptors not found"); - NS_TEST_ASSERT_MSG_LT(m_panDescriptorList[0].m_linkQuality, - 255, - "Error, Coordinator 1 (PAN 5) LQI value should be less than 255."); - NS_TEST_ASSERT_MSG_LT(m_panDescriptorList[1].m_linkQuality, - 255, - "Error, Coordinator 2 (PAN 7) LQI value should be less than 255."); - NS_TEST_ASSERT_MSG_GT(m_panDescriptorList[0].m_linkQuality, - 0, - "Error, Coordinator 1 (PAN 5) LQI value should be greater than 0."); - NS_TEST_ASSERT_MSG_GT(m_panDescriptorList[1].m_linkQuality, - 0, - "Error, Coordinator 2 (PAN 7) LQI value should be greater than 0."); - NS_TEST_ASSERT_MSG_LT( - m_panDescriptorList[1].m_linkQuality, - m_panDescriptorList[0].m_linkQuality, - "Error, Coordinator 2 (PAN 7) LQI value should be less than Coordinator 1 (PAN 5)."); + if (m_panDescriptorList.size() == 2) + { + NS_TEST_ASSERT_MSG_LT(m_panDescriptorList[0].m_linkQuality, + 255, + "Error, Coordinator 1 (PAN 5) LQI value should be less than 255."); + NS_TEST_ASSERT_MSG_LT(m_panDescriptorList[1].m_linkQuality, + 255, + "Error, Coordinator 2 (PAN 7) LQI value should be less than 255."); + NS_TEST_ASSERT_MSG_GT(m_panDescriptorList[0].m_linkQuality, + 0, + "Error, Coordinator 1 (PAN 5) LQI value should be greater than 0."); + NS_TEST_ASSERT_MSG_GT(m_panDescriptorList[1].m_linkQuality, + 0, + "Error, Coordinator 2 (PAN 7) LQI value should be greater than 0."); - NS_TEST_EXPECT_MSG_EQ(g_beaconPayloadSize, - 25, - "Error, Beacon Payload not received or incorrect size (25 bytes)"); + NS_TEST_ASSERT_MSG_LT(m_panDescriptorList[1].m_linkQuality, + m_panDescriptorList[0].m_linkQuality, + "Error, Coordinator 2 (PAN 7) LQI value should" + " be less than Coordinator 1 (PAN 5)."); + + NS_TEST_EXPECT_MSG_EQ(g_beaconPayloadSize, + 25, + "Error, Beacon Payload not received or incorrect size (25 bytes)"); + } + + Simulator::Destroy(); +} + +/** + * \ingroup lr-wpan-test + * \ingroup tests + * + * \brief Test MAC Orphan Scan Coordinator Realignment command reception and its values. + */ +class TestOrphanScan : public TestCase +{ + public: + TestOrphanScan(); + ~TestOrphanScan() override; + + private: + /** + * Function called in response to a MAC scan request. + * + * \param params MLME scan confirm parameters + */ + void ScanConfirm(MlmeScanConfirmParams params); + + /** + * Function called as a result of receiving an orphan notification command + * on the coordinator + * + * \param params MLME orphan indication parameters + */ + void OrphanIndicationCoord(MlmeOrphanIndicationParams params); + + void DoRun() override; + + Ptr coord1NetDevice; //!< The LrWpanNetDevice of coordinator 1 + Ptr endNodeNetDevice; //!< The LrWpanNetDevice of the end device + bool m_orphanScanSuccess; //!< Indicates a successful orphan scan +}; + +TestOrphanScan::TestOrphanScan() + : TestCase("Test an orphan scan and the reception of the commands involved") +{ + m_orphanScanSuccess = false; +} + +TestOrphanScan::~TestOrphanScan() +{ +} + +void +TestOrphanScan::ScanConfirm(MlmeScanConfirmParams params) +{ + if (params.m_status == MLMESCAN_SUCCESS) + { + m_orphanScanSuccess = true; + } +} + +void +TestOrphanScan::OrphanIndicationCoord(MlmeOrphanIndicationParams params) +{ + // The steps taken by the coordinator on the event of an orphan indication + // are meant to be implemented by the next higher layer and are out of the scope of the + // standard. In this test, we assume that coordinator 2 already has + // the endDevice [00:00:00:00:00:00:00:03] registered and therefore reply to this device + // a with a coordidinator realignment command. + + if (params.m_orphanAddr == Mac64Address("00:00:00:00:00:00:00:02")) + { + MlmeOrphanResponseParams respParams; + respParams.m_assocMember = true; + respParams.m_orphanAddr = params.m_orphanAddr; + respParams.m_shortAddr = Mac16Address("00:02"); + + Simulator::ScheduleNow(&LrWpanMac::MlmeOrphanResponse, + coord1NetDevice->GetMac(), + respParams); + } +} + +void +TestOrphanScan::DoRun() +{ + // Create 2 PAN coordinator nodes, and 1 end device + Ptr coord1 = CreateObject(); + Ptr endNode = CreateObject(); + + coord1NetDevice = CreateObject(); + endNodeNetDevice = CreateObject(); + + // PAN Coordinators configurations require to set both, the EUI-64 (extended address) + // and to assign their own short address. + coord1NetDevice->GetMac()->SetExtendedAddress(Mac64Address("00:00:00:00:00:00:00:01")); + coord1NetDevice->GetMac()->SetShortAddress(Mac16Address("00:01")); + + // Other devices must have only its EUI-64 and later on, their short address is + // potentially assigned by the coordinator. + endNodeNetDevice->GetMac()->SetExtendedAddress(Mac64Address("00:00:00:00:00:00:00:02")); + + // Configure Spectrum channel + Ptr channel = CreateObject(); + Ptr propModel = + CreateObject(); + Ptr delayModel = + CreateObject(); + channel->AddPropagationLossModel(propModel); + channel->SetPropagationDelayModel(delayModel); + + coord1NetDevice->SetChannel(channel); + endNodeNetDevice->SetChannel(channel); + + coord1->AddDevice(coord1NetDevice); + endNode->AddDevice(endNodeNetDevice); + + // Mobility + Ptr coord1Mobility = + CreateObject(); + coord1Mobility->SetPosition(Vector(0, 0, 0)); + coord1NetDevice->GetPhy()->SetMobility(coord1Mobility); + + Ptr endNodeMobility = + CreateObject(); + endNodeMobility->SetPosition(Vector(100, 0, 0)); + endNodeNetDevice->GetPhy()->SetMobility(endNodeMobility); + + // MAC layer Callbacks hooks + MlmeScanConfirmCallback cb1; + cb1 = MakeCallback(&TestOrphanScan::ScanConfirm, this); + endNodeNetDevice->GetMac()->SetMlmeScanConfirmCallback(cb1); + + MlmeOrphanIndicationCallback cb2; + cb2 = MakeCallback(&TestOrphanScan::OrphanIndicationCoord, this); + coord1NetDevice->GetMac()->SetMlmeOrphanIndicationCallback(cb2); + ///////////////// + // ORPHAN SCAN // + ///////////////// + + // PAN coordinator N0 (PAN 5) is set to channel 12 in non-beacon mode + // but answer to beacon request and orphan notification commands. + MlmeStartRequestParams params; + params.m_panCoor = true; + params.m_PanId = 5; + params.m_bcnOrd = 15; + params.m_sfrmOrd = 15; + params.m_logCh = 12; + Simulator::ScheduleWithContext(1, + Seconds(2.0), + &LrWpanMac::MlmeStartRequest, + coord1NetDevice->GetMac(), + params); + + // End device N1 is set to scan 4 channels looking for the presence of a coordinator. + // On each channel, a single orphan notification command is sent and a response is + // waited for a maximum time of macResponseWaitTime. If a reply is received from a + // coordinator within this time (coordinator realignment command), the programmed scans on + // other channels is suspended. + // Scan Channels are represented by bits 0-26 (27 LSB) + // ch 14 ch 11 + // | | + // 0x7800 = 0000000000000000111100000000000 + MlmeScanRequestParams scanParams; + scanParams.m_chPage = 0; + scanParams.m_scanChannels = 0x7800; + scanParams.m_scanType = MLMESCAN_ORPHAN; + Simulator::ScheduleWithContext(1, + Seconds(3.0), + &LrWpanMac::MlmeScanRequest, + endNodeNetDevice->GetMac(), + scanParams); + + Simulator::Stop(Seconds(4000)); + NS_LOG_DEBUG("----------- Start of TestOrphanScan -------------------"); + Simulator::Run(); + + NS_TEST_EXPECT_MSG_EQ(m_orphanScanSuccess, + true, + "Error, no coordinator realignment commands" + " received during orphan scan"); + if (m_orphanScanSuccess) + { + NS_TEST_EXPECT_MSG_EQ(endNodeNetDevice->GetMac()->GetShortAddress(), + Mac16Address("00:02"), + "Error, end device did not receive short address" + " during orphan scan"); + } Simulator::Destroy(); } @@ -530,6 +719,7 @@ LrWpanMacTestSuite::LrWpanMacTestSuite() { AddTestCase(new TestRxOffWhenIdleAfterCsmaFailure, TestCase::QUICK); AddTestCase(new TestActiveScanPanDescriptors, TestCase::QUICK); + AddTestCase(new TestOrphanScan, TestCase::QUICK); } static LrWpanMacTestSuite g_lrWpanMacTestSuite; //!< Static variable for test initialization From af1a66514a54bae0770a61f32913afddd25a1eb8 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 24 Mar 2023 13:48:26 -0300 Subject: [PATCH 017/434] build: pass Python information to CMake via the ns3 script Allows use of different python installations on the same system. --- ns3 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ns3 b/ns3 index 08deb28c6..35b18e2c9 100755 --- a/ns3 +++ b/ns3 @@ -610,6 +610,14 @@ def configure_cmake(cmake, args, current_cmake_cache_folder, current_cmake_gener if args.G is None: args.G = current_cmake_generator + # Get the current Python information to supply + # CMake with the respective installation + if args.enable_python_bindings is True: + import sysconfig + cmake_args.append(f"-DPython3_LIBRARY_DIRS={sysconfig.get_config_var('LIBDIR')}") + cmake_args.append(f"-DPython3_INCLUDE_DIRS={sysconfig.get_config_var('INCLUDEPY')}") + cmake_args.append(f"-DPython3_EXECUTABLE={sys.executable}") + # C++ standard if args.cxx_standard is not None: cmake_args.append("-DCMAKE_CXX_STANDARD=%s" % args.cxx_standard) From 8b8025e63c47b9bbaf6de9cc1ad8bda628553889 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 24 Mar 2023 14:09:34 -0300 Subject: [PATCH 018/434] build: inform that NS3_BINDINGS_INSTALL_DIR is meant for redistribution --- build-support/macros-and-definitions.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/build-support/macros-and-definitions.cmake b/build-support/macros-and-definitions.cmake index 5d4e32ce9..34476a9f5 100644 --- a/build-support/macros-and-definitions.cmake +++ b/build-support/macros-and-definitions.cmake @@ -903,6 +903,7 @@ macro(process_options) message( ${HIGHLIGHTED_STATUS} "NS3_BINDINGS_INSTALL_DIR was not set. The python bindings won't be installed with ./ns3 install." + "This setting is meant for packaging and redistribution." ) message( ${HIGHLIGHTED_STATUS} From 8a480ca500da0cf1ce0f1847c82eb598b9efcbb6 Mon Sep 17 00:00:00 2001 From: Raghuram Date: Sun, 26 Mar 2023 23:27:09 +0530 Subject: [PATCH 019/434] Fixes Dark mode support(issue#829) --- doc/doxygen.conf | 2 +- doc/ns3_html_theme/static/ns3_stylesheet.css | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/doxygen.conf b/doc/doxygen.conf index 1ee923022..4f78da138 100644 --- a/doc/doxygen.conf +++ b/doc/doxygen.conf @@ -2693,5 +2693,5 @@ GENERATE_LEGEND = YES DOT_CLEANUP = YES # Disable dark mode in the generated HTML in Doxygen 1.9.6 or greater. -HTML_COLORSTYLE = LIGHT +# HTML_COLORSTYLE = LIGHT diff --git a/doc/ns3_html_theme/static/ns3_stylesheet.css b/doc/ns3_html_theme/static/ns3_stylesheet.css index c20341dbc..e71944956 100644 --- a/doc/ns3_html_theme/static/ns3_stylesheet.css +++ b/doc/ns3_html_theme/static/ns3_stylesheet.css @@ -10,16 +10,21 @@ dl { font-size: 12px; } -/* Dark mode is not supported in Doxygen versions earlier than 1.9.6 +/* Dark mode is not supported in Doxygen versions earlier than 1.9.6 */ @media (prefers-color-scheme: dark) { body, table, div, p, - dl { + dl, + div.body, + div.sphinxsidebar h3, + div.sphinxsidebar h4 , + div.sphinxsidebar h3 a{ color: ivory; + background:black; } -} */ +} a { color: #91A501; @@ -110,8 +115,8 @@ div.sphinxsidebar a { } #projecttext { - align: left; - font-color: white; + text-align: left; + color: white; padding-left: 2em; width: 250px; } From 1083229fe15ddffd4a3f42cb8310ec410a49515d Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Date: Mon, 27 Mar 2023 14:42:26 +0900 Subject: [PATCH 020/434] network: Add ConvertToInt to Mac64Address --- CHANGES.md | 1 + RELEASE_NOTES.md | 1 + src/network/utils/mac64-address.cc | 19 +++++++++++++++++++ src/network/utils/mac64-address.h | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0afc469d8..6cdb56498 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Changes from ns-3.38 to ns-3-dev ### New API * (lr-wpan) Added support for orphan scans. Orphan scans can now be performed using the existing `LrWpanMac::MlmeScanRequest`; This orphan scan use the added orphan notification commands and coordinator realigment commands. Usage is shown in added `lr-wpan-orphan-scan.cc` example and in the `TestOrphanScan` included in `lr-wpan-mac-test.cc`. +* (network) Added `Mac64Address::ConvertToInt`. Converts a Mac64Address object to a uint64_t. ### Changes to existing API diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e99d528ed..76ca88fd5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -21,6 +21,7 @@ Release 3-dev ### New user-visible features - (lr-wpan) !1399 - Add orphan scan support. +- (network) !1405 - Add ConvertToInt to Mac64Address ### Bugs fixed diff --git a/src/network/utils/mac64-address.cc b/src/network/utils/mac64-address.cc index 6340f2b55..0818523bf 100644 --- a/src/network/utils/mac64-address.cc +++ b/src/network/utils/mac64-address.cc @@ -147,6 +147,25 @@ Mac64Address::ConvertTo() const return Address(GetType(), m_address, 8); } +uint64_t +Mac64Address::ConvertToInt() const +{ + uint64_t addr = 0; + uint64_t shift = 0xFF; + + addr = static_cast(m_address[7]) & (shift); + addr |= (static_cast(m_address[6]) << 8) & (shift << 8); + addr |= (static_cast(m_address[5]) << 16) & (shift << 16); + addr |= (static_cast(m_address[4]) << 24) & (shift << 24); + + addr |= (static_cast(m_address[3]) << 32) & (shift << 32); + addr |= (static_cast(m_address[2]) << 40) & (shift << 40); + addr |= (static_cast(m_address[1]) << 48) & (shift << 48); + addr |= (static_cast(m_address[0]) << 56) & (shift << 56); + + return addr; +} + Mac64Address Mac64Address::Allocate() { diff --git a/src/network/utils/mac64-address.h b/src/network/utils/mac64-address.h index a6ebcb473..172e6a375 100644 --- a/src/network/utils/mac64-address.h +++ b/src/network/utils/mac64-address.h @@ -87,6 +87,13 @@ class Mac64Address */ Address ConvertTo() const; + /** + * \return the mac address in a 64 bit int + * + * Convert an instance of this class to a 64 bit int. + */ + uint64_t ConvertToInt() const; + /** * \param address address to test * \returns true if the address matches, false otherwise. From eed35c21313698b7759f04f0180e58405502895a Mon Sep 17 00:00:00 2001 From: Biljana Bojovic Date: Sat, 25 Mar 2023 16:58:50 +0100 Subject: [PATCH 021/434] spectrum: Use uint32_t instead of uint8_t for m_rbNum and m_timeGranularity in TraceFadingLossModel With NR we can have a larger number of RBs than we could have in past with LTE. In LTE the maximum was 100RBs for 20MHz BW, while in NR it could go e.g. up to 275. Hence, uint8_t is not sufficient any more. Similarly, m_timeGranularity needs to support higher values. --- src/spectrum/model/trace-fading-loss-model.cc | 2 +- src/spectrum/model/trace-fading-loss-model.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectrum/model/trace-fading-loss-model.cc b/src/spectrum/model/trace-fading-loss-model.cc index 3a02633e4..d15d751e9 100644 --- a/src/spectrum/model/trace-fading-loss-model.cc +++ b/src/spectrum/model/trace-fading-loss-model.cc @@ -84,7 +84,7 @@ TraceFadingLossModel::GetTypeId() "The number of RB the trace is made of (default 100)", UintegerValue(100), MakeUintegerAccessor(&TraceFadingLossModel::m_rbNum), - MakeUintegerChecker()) + MakeUintegerChecker()) .AddAttribute( "RngStreamSetSize", "The number of RNG streams reserved for the fading model. The maximum number of " diff --git a/src/spectrum/model/trace-fading-loss-model.h b/src/spectrum/model/trace-fading-loss-model.h index 1e22defe0..a53b40394 100644 --- a/src/spectrum/model/trace-fading-loss-model.h +++ b/src/spectrum/model/trace-fading-loss-model.h @@ -122,9 +122,9 @@ class TraceFadingLossModel : public SpectrumPropagationLossModel Time m_traceLength; ///< the trace time uint32_t m_samplesNum; ///< number of samples Time m_windowSize; ///< window size - uint8_t m_rbNum; ///< RB number + uint32_t m_rbNum; ///< RB number mutable Time m_lastWindowUpdate; ///< time of last window update - uint8_t m_timeGranularity; ///< time granularity + uint32_t m_timeGranularity; ///< time granularity mutable uint64_t m_currentStream; ///< the current stream mutable uint64_t m_lastStream; ///< the last stream uint64_t m_streamSetSize; ///< stream set size From 1e49101c392c1ab3ea891c3fb6ae359cfc36cf2c Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Tue, 28 Mar 2023 17:01:31 +0900 Subject: [PATCH 022/434] lr-wpan: Fixes issues during MAC scan --- RELEASE_NOTES.md | 2 ++ src/lr-wpan/model/lr-wpan-mac.cc | 38 +++++++++++++++++--------------- src/lr-wpan/model/lr-wpan-mac.h | 6 +++-- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 76ca88fd5..df2396f74 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -25,6 +25,8 @@ Release 3-dev ### Bugs fixed +- (lr-wpan) !1406 - Fixes issues during MAC scan + Release 3.38 ------------ diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 95653b64e..87b8bdf0e 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -1393,14 +1393,14 @@ LrWpanMac::EndChannelScan() NS_LOG_ERROR(this << " Invalid scan type"); } + m_pendPrimitive = MLME_NONE; + m_channelScanIndex = 0; + m_scanParams = {}; + if (!m_mlmeScanConfirmCallback.IsNull()) { m_mlmeScanConfirmCallback(confirmParams); } - - m_pendPrimitive = MLME_NONE; - m_channelScanIndex = 0; - m_scanParams = {}; } } @@ -1443,19 +1443,21 @@ LrWpanMac::EndChannelEnergyScan() // (i.e when a coordinator perform a scan and it was already transmitting beacons) // All channels scanned, report success - if (!m_mlmeScanConfirmCallback.IsNull()) - { - MlmeScanConfirmParams confirmParams; - confirmParams.m_status = MLMESCAN_SUCCESS; - confirmParams.m_chPage = m_phy->GetCurrentPage(); - confirmParams.m_scanType = m_scanParams.m_scanType; - confirmParams.m_energyDetList = m_energyDetectList; - confirmParams.m_resultListSize = m_energyDetectList.size(); - m_mlmeScanConfirmCallback(confirmParams); - } + MlmeScanConfirmParams confirmParams; + confirmParams.m_status = MLMESCAN_SUCCESS; + confirmParams.m_chPage = m_phy->GetCurrentPage(); + confirmParams.m_scanType = m_scanParams.m_scanType; + confirmParams.m_energyDetList = m_energyDetectList; + confirmParams.m_resultListSize = m_energyDetectList.size(); + m_pendPrimitive = MLME_NONE; m_channelScanIndex = 0; m_scanParams = {}; + + if (!m_mlmeScanConfirmCallback.IsNull()) + { + m_mlmeScanConfirmCallback(confirmParams); + } } } @@ -3361,10 +3363,10 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu } else { - uint64_t scanDuration = - lrwpan::aBaseSuperframeDuration * - ((static_cast(1 << m_scanParams.m_scanDuration)) + 1); - nextScanTime = Seconds(static_cast(scanDuration / symbolRate)); + uint64_t scanDurationSym = + lrwpan::aBaseSuperframeDuration * (pow(2, m_scanParams.m_scanDuration) + 1); + + nextScanTime = Seconds(static_cast(scanDurationSym) / symbolRate); } switch (m_scanParams.m_scanType) diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index a1024106f..73b132642 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -510,8 +510,10 @@ struct MlmeScanRequestParams uint32_t m_scanChannels{0x7FFF800}; //!< The channel numbers to be scanned. //!< Default: (0x7FFF800 = Ch11-Ch26) //!< 27 LSB (b0,b1,...,b26) = channels - uint8_t m_scanDuration{14}; //!< A value used to calculate the length of time to spend scanning - //!< [aBaseSuperframeDuration * (2^m_scanDuration +)]. + uint8_t m_scanDuration{14}; //!< The factor (0-14) used to calculate the length of time + //!< to spend scanning. + //!< scanDurationSymbols = + //!< [aBaseSuperframeDuration * (2^m_scanDuration + 1)]. uint32_t m_chPage{0}; //!< The channel page on which to perform scan. }; From d9499afc72a2056a221a2b65a28aadf42b454fa5 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Thu, 30 Mar 2023 19:16:47 -0300 Subject: [PATCH 023/434] build: properly propagate included directories from dependencies --- .../custom-modules/ns3-module-macros.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build-support/custom-modules/ns3-module-macros.cmake b/build-support/custom-modules/ns3-module-macros.cmake index 91398da5f..614639c41 100644 --- a/build-support/custom-modules/ns3-module-macros.cmake +++ b/build-support/custom-modules/ns3-module-macros.cmake @@ -193,6 +193,20 @@ function(build_lib) ${lib${BLIB_LIBNAME}} ${exported_libraries} ${private_libraries} ) + if(NOT ${XCODE}) + # Since linking libraries to object libraries in not allowed in older CMake + # releases, we need to import each of their include directories. Otherwise, + # include directories won't be properly propagated + set(temp) + foreach(target ${ns_libraries_to_link}) + list(APPEND temp + "$" + ) + endforeach() + target_include_directories(${lib${BLIB_LIBNAME}}-obj PRIVATE ${temp}) + unset(temp) + endif() + # set output name of library set_target_properties( ${lib${BLIB_LIBNAME}} From eb9448716bd1ed0b18c1843b47820d9b5f6c57b2 Mon Sep 17 00:00:00 2001 From: Robert-ML <37192540+Robert-ML@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:17:02 +0200 Subject: [PATCH 024/434] wifi: Correct uint32_t division to double --- src/wifi/model/rate-control/rraa-wifi-manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wifi/model/rate-control/rraa-wifi-manager.cc b/src/wifi/model/rate-control/rraa-wifi-manager.cc index d5514a690..e78e106dd 100644 --- a/src/wifi/model/rate-control/rraa-wifi-manager.cc +++ b/src/wifi/model/rate-control/rraa-wifi-manager.cc @@ -445,7 +445,7 @@ RraaWifiManager::RunBasicAlgorithm(RraaWifiRemoteStation* station) { NS_LOG_FUNCTION(this << station); WifiRraaThresholds thresholds = GetThresholds(station, station->m_rateIndex); - double ploss = (station->m_nFailed / thresholds.m_ewnd); + auto ploss = (static_cast(station->m_nFailed) / thresholds.m_ewnd); if (station->m_counter == 0 || ploss > thresholds.m_mtl) { if (ploss > thresholds.m_mtl) From 174dbb7e1cc703f3bc9603a18d7beadec7cd198d Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 31 Mar 2023 16:21:28 -0700 Subject: [PATCH 025/434] doc: Fix broken link on menu bar --- doc/ns3_html_theme/static/ns3_links.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ns3_html_theme/static/ns3_links.js b/doc/ns3_html_theme/static/ns3_links.js index ef58a3755..7e5c947be 100644 --- a/doc/ns3_html_theme/static/ns3_links.js +++ b/doc/ns3_html_theme/static/ns3_links.js @@ -44,7 +44,7 @@ var ns3_man = ns3_rel + "manual/" + ns3_index; var ns3_mod = ns3_rel + "models/" + ns3_index; var ns3_tut = ns3_rel + "tutorial/" + ns3_index; var ns3_con = ns3_rel + "contributing/" + ns3_index; -var ns3_con = ns3_rel + "installation/" + ns3_index; +var ns3_ins = ns3_rel + "installation/" + ns3_index; function ns3_write_links() { document.getElementById("ns3_home1").href = ns3_home; From 0132e159df104a57d81cfc0d7bb5a1ae6e5ec638 Mon Sep 17 00:00:00 2001 From: pagmatt Date: Wed, 29 Mar 2023 15:30:47 -0400 Subject: [PATCH 026/434] antenna: Remove deprecated ComputeNorm declaration --- src/antenna/model/phased-array-model.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/antenna/model/phased-array-model.h b/src/antenna/model/phased-array-model.h index 563bb8b3c..9f6472536 100644 --- a/src/antenna/model/phased-array-model.h +++ b/src/antenna/model/phased-array-model.h @@ -140,13 +140,6 @@ class PhasedArrayModel : public Object uint32_t GetId() const; protected: - /** - * Utility method to compute the euclidean norm of a ComplexVector - * \param vector the ComplexVector - * \return the euclidean norm - */ - static double ComputeNorm(const ComplexVector& vector); - ComplexVector m_beamformingVector; //!< the beamforming vector in use Ptr m_antennaElement; //!< the model of the antenna element in use bool m_isBfVectorValid; //!< ensures the validity of the beamforming vector From 8aca64eacc6cf0889090b2eb0d8365d25c6697c3 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Date: Sun, 26 Mar 2023 23:37:17 +0900 Subject: [PATCH 027/434] lr-wpan: Add attributes to MLME-SET and MLME-GET --- CHANGES.md | 4 ++ RELEASE_NOTES.md | 1 + src/lr-wpan/model/lr-wpan-mac.cc | 98 +++++++++++++++++++++++--------- src/lr-wpan/model/lr-wpan-mac.h | 64 +++++++++++++++++++-- src/lr-wpan/model/lr-wpan-phy.cc | 34 +++++------ src/lr-wpan/model/lr-wpan-phy.h | 9 ++- 6 files changed, 157 insertions(+), 53 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6cdb56498..05df6c866 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ Changes from ns-3.38 to ns-3-dev * (lr-wpan) Added support for orphan scans. Orphan scans can now be performed using the existing `LrWpanMac::MlmeScanRequest`; This orphan scan use the added orphan notification commands and coordinator realigment commands. Usage is shown in added `lr-wpan-orphan-scan.cc` example and in the `TestOrphanScan` included in `lr-wpan-mac-test.cc`. * (network) Added `Mac64Address::ConvertToInt`. Converts a Mac64Address object to a uint64_t. +* (lr-wpan) Added `LrwpanMac::MlmeGetRequest` function and the corresponding confirm callbacks as well as `LrwpanMac::SetMlmeGetConfirm` function. ### Changes to existing API @@ -44,6 +45,9 @@ Changes from ns-3.38 to ns-3-dev * (wifi) The spelling of the define `IE_BEAMLINK_MAINENANCE` from `wifi-information-element.h` was corrected to `IE_BEAMLINK_MAINTENANCE`; this will affect existing users who were using the define with the misspelling. * (wimax) The spelling of the attribute `m_nrRecivedFecBlocks` from `simple-ofdm-wimax-phy.h` was corrected to `m_nrReceivedFecBlocks`; this will affect existing users who were using the attribute with the misspelling. * (sixlowpan) The spelling of the function `SixLowPanNetDevice::Fragments::GetFraments` from `sixlowpan-net-device.cc` was corrected to `SixLowPanNetDevice::Fragments::GetFragments`; this will affect existing users who were using the function with the misspelling. +* (lr-wpan) Updated `LrWpanPhy::PlmeSetAttribute` and `LrWpanPhy::PlmeGetAttribute` (Request and Confirm) to use smart pointers. +* (lr-wpan) Modified `LrWpanPhy::PlmeGetAttributeRequest` to include support for a few attributes (none were supported before the change). +* (lr-wpan) Added `macShortAddress` and `macExtendendAddress` to the attributes that can be use with MLME-GET and MLME-SET functions. ### Changes to build system diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index df2396f74..673a914d2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,7 @@ Release 3-dev - (lr-wpan) !1399 - Add orphan scan support. - (network) !1405 - Add ConvertToInt to Mac64Address +- (lr-wpan) !1402 - Add attributes to MLME-SET and MLME-GET ### Bugs fixed diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 87b8bdf0e..2ad126fe4 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -579,9 +579,9 @@ LrWpanMac::MlmeStartRequest(MlmeStartRequestParams params) m_pendPrimitive = MLME_START_REQ; m_startParams = params; - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentPage = m_startParams.m_logChPage; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentPage = m_startParams.m_logChPage; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, pibAttr); } void @@ -639,9 +639,9 @@ LrWpanMac::MlmeScanRequest(MlmeScanRequestParams params) m_scanParams = params; m_pendPrimitive = MLME_SCAN_REQ; - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentPage = params.m_chPage; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentPage = params.m_chPage; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, pibAttr); } void @@ -693,9 +693,9 @@ LrWpanMac::MlmeAssociateRequest(MlmeAssociateRequestParams params) } else { - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentPage = params.m_chPage; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentPage = params.m_chPage; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentPage, pibAttr); } } @@ -849,9 +849,9 @@ LrWpanMac::MlmeSyncRequest(MlmeSyncRequestParams params) uint64_t symbolRate = (uint64_t)m_phy->GetDataOrSymbolRate(false); // symbols per second // change phy current logical channel - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = params.m_logCh; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = params.m_logCh; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, pibAttr); // Enable Phy receiver m_phy->PlmeSetTRXStateRequest(IEEE_802_15_4_PHY_RX_ON); @@ -917,6 +917,11 @@ LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, PtrmacShortAddress; + case macExtendedAddress: + confirmParams.m_status = MLMESET_READ_ONLY; default: // TODO: Add support for setting other attributes confirmParams.m_status = MLMESET_UNSUPPORTED_ATTRIBUTE; @@ -930,6 +935,37 @@ LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, Ptr attributes = Create(); + + switch (id) + { + case macBeaconPayload: + attributes->macBeaconPayload = m_macBeaconPayload; + break; + case macBeaconPayloadLength: + attributes->macBeaconPayloadLength = m_macBeaconPayloadLength; + break; + case macShortAddress: + attributes->macShortAddress = m_shortAddress; + break; + case macExtendedAddress: + attributes->macExtendedAddress = m_selfExt; + break; + default: + status = MLMEGET_UNSUPPORTED_ATTRIBUTE; + break; + } + + if (!m_mlmeGetConfirmCallback.IsNull()) + { + m_mlmeGetConfirmCallback(status, id, attributes); + } +} + void LrWpanMac::SendOneBeacon() { @@ -1333,9 +1369,9 @@ LrWpanMac::EndChannelScan() if (channelFound) { // Switch to the next channel in the list and restart scan - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = m_channelScanIndex; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = m_channelScanIndex; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, pibAttr); } else { @@ -1428,9 +1464,9 @@ LrWpanMac::EndChannelEnergyScan() if (channelFound) { // switch to the next channel in the list and restart scan - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = m_channelScanIndex; - m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, &pibAttr); + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = m_channelScanIndex; + m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, pibAttr); } else { @@ -1803,6 +1839,12 @@ LrWpanMac::SetMlmeSetConfirmCallback(MlmeSetConfirmCallback c) m_mlmeSetConfirmCallback = c; } +void +LrWpanMac::SetMlmeGetConfirmCallback(MlmeGetConfirmCallback c) +{ + m_mlmeGetConfirmCallback = c; +} + void LrWpanMac::PdDataIndication(uint32_t psduLength, Ptr p, uint8_t lqi) { @@ -3252,7 +3294,7 @@ LrWpanMac::PlmeEdConfirm(LrWpanPhyEnumeration status, uint8_t energyLevel) void LrWpanMac::PlmeGetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, - LrWpanPhyPibAttributes* attribute) + Ptr attribute) { NS_LOG_FUNCTION(this << status << id << attribute); } @@ -3330,10 +3372,10 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu if (channelFound) { - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = m_channelScanIndex; + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = m_channelScanIndex; m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, - &pibAttr); + pibAttr); } } else @@ -3425,10 +3467,10 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu { if (status == LrWpanPhyEnumeration::IEEE_802_15_4_PHY_SUCCESS) { - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = m_startParams.m_logCh; + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = m_startParams.m_logCh; m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, - &pibAttr); + pibAttr); } else { @@ -3464,10 +3506,10 @@ LrWpanMac::PlmeSetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttribu { if (status == LrWpanPhyEnumeration::IEEE_802_15_4_PHY_SUCCESS) { - LrWpanPhyPibAttributes pibAttr; - pibAttr.phyCurrentChannel = m_associateParams.m_chNum; + Ptr pibAttr = Create(); + pibAttr->phyCurrentChannel = m_associateParams.m_chNum; m_phy->PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier::phyCurrentChannel, - &pibAttr); + pibAttr); } else { diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index 73b132642..42f0c8488 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -323,6 +323,17 @@ enum LrWpanMlmeSetConfirmStatus MLMESET_INVALID_PARAMETER = 4 }; +/** + * \ingroup lr-wpan + * + * Table 20 of IEEE 802.15.4-2011 + */ +enum LrWpanMlmeGetConfirmStatus +{ + MLMEGET_SUCCESS = 0, + MLMEGET_UNSUPPORTED_ATTRIBUTE = 1 +}; + /** * \ingroup lr-wpan * @@ -332,7 +343,10 @@ enum LrWpanMlmeSetConfirmStatus enum LrWpanMacPibAttributeIdentifier { macBeaconPayload = 0, - macBeaconPayloadLength = 1 + macBeaconPayloadLength = 1, + macShortAddress = 2, + macExtendedAddress = 3, + unsupported = 255 // TODO: complete other MAC pib attributes }; @@ -345,6 +359,8 @@ struct LrWpanMacPibAttributes : public SimpleRefCount { Ptr macBeaconPayload; //!< The contents of the beacon payload. uint8_t macBeaconPayloadLength{0}; //!< The length in octets of the beacon payload. + Mac16Address macShortAddress; //!< The 16 bit mac short address + Mac64Address macExtendedAddress; //!< The EUI-64 bit address // TODO: complete other MAC pib attributes }; @@ -673,9 +689,9 @@ struct MlmePollConfirmParams */ struct MlmeSetConfirmParams { - LrWpanMlmeSetConfirmStatus m_status{ - MLMESET_UNSUPPORTED_ATTRIBUTE}; //!< The result of the request to write - //!< the PIB attribute. + LrWpanMlmeSetConfirmStatus m_status{MLMESET_UNSUPPORTED_ATTRIBUTE}; //!< The result of + //!< the request to write + //!< the PIB attribute. LrWpanMacPibAttributeIdentifier id; //!< The id of the PIB attribute that was written. }; @@ -798,6 +814,19 @@ typedef Callback MlmeOrphanIndicationCallback; */ typedef Callback MlmeSetConfirmCallback; +/** + * \ingroup lr-wpan + * + * This callback is called after a MlmeGetRequest has been called from + * the higher layer to get a PIB. It returns a status of the outcome of the + * write attempt. + */ +typedef Callback> + MlmeGetConfirmCallback; + /** * \ingroup lr-wpan * @@ -978,6 +1007,15 @@ class LrWpanMac : public Object */ void MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, Ptr attribute); + /** + * IEEE 802.15.4-2011, section 6.2.5.1 + * MLME-GET.request + * Request information about a given PIB attribute. + * + * \param id the attribute identifier + */ + void MlmeGetRequest(LrWpanMacPibAttributeIdentifier id); + /** * Set the CSMA/CA implementation to be used by the MAC. * @@ -1107,6 +1145,15 @@ class LrWpanMac : public Object */ void SetMlmeSetConfirmCallback(MlmeSetConfirmCallback c); + /** + * Set the callback for the confirmation of an attempt to read an attribute. + * The callback implements MLME-GET.confirm SAP of IEEE 802.15.4-2011, + * section 6.2.5.2 + * + *\param c the callback + */ + void SetMlmeGetConfirmCallback(MlmeGetConfirmCallback c); + // interfaces between MAC and PHY /** @@ -1152,7 +1199,7 @@ class LrWpanMac : public Object */ void PlmeGetAttributeConfirm(LrWpanPhyEnumeration status, LrWpanPibAttributeIdentifier id, - LrWpanPhyPibAttributes* attribute); + Ptr attribute); /** * IEEE 802.15.4-2006 section 6.2.2.8 @@ -1966,6 +2013,13 @@ class LrWpanMac : public Object */ MlmeSetConfirmCallback m_mlmeSetConfirmCallback; + /** + * This callback is used to report the result of an attribute read request + * to the upper layers. + * See IEEE 802.15.4-2011, section 6.2.5.2 + */ + MlmeGetConfirmCallback m_mlmeGetConfirmCallback; + /** * This callback is used to notify incoming beacon packets to the upper layers. * See IEEE 802.15.4-2011, section 6.2.4.1. diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index 5a6d81674..81e17a8bf 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -230,7 +230,7 @@ LrWpanPhy::DoDispose() m_plmeGetAttributeConfirmCallback = MakeNullCallback(); + Ptr>(); m_plmeSetTRXStateConfirmCallback = MakeNullCallback(); m_plmeSetAttributeConfirmCallback = MakeNullCallback(); @@ -737,31 +737,31 @@ void LrWpanPhy::PlmeGetAttributeRequest(LrWpanPibAttributeIdentifier id) { NS_LOG_FUNCTION(this << id); - LrWpanPhyEnumeration status; + LrWpanPhyEnumeration status = IEEE_802_15_4_PHY_SUCCESS; + Ptr attributes = Create(); switch (id) { case phyCurrentChannel: - case phyChannelsSupported: - case phyTransmitPower: - case phyCCAMode: - case phyCurrentPage: - case phyMaxFrameDuration: - case phySHRDuration: - case phySymbolsPerOctet: { - status = IEEE_802_15_4_PHY_SUCCESS; + attributes->phyCurrentChannel = m_phyPIBAttributes.phyCurrentChannel; break; - } - default: { + case phyCurrentPage: + attributes->phyCurrentPage = m_phyPIBAttributes.phyCurrentPage; + break; + case phySHRDuration: + attributes->phySHRDuration = GetPhySHRDuration(); + break; + case phySymbolsPerOctet: + attributes->phySymbolsPerOctet = GetPhySymbolsPerOctet(); + break; + default: status = IEEE_802_15_4_PHY_UNSUPPORTED_ATTRIBUTE; break; } - } + if (!m_plmeGetAttributeConfirmCallback.IsNull()) { - LrWpanPhyPibAttributes retValue; - memcpy(&retValue, &m_phyPIBAttributes, sizeof(LrWpanPhyPibAttributes)); - m_plmeGetAttributeConfirmCallback(status, id, &retValue); + m_plmeGetAttributeConfirmCallback(status, id, attributes); } } @@ -996,7 +996,7 @@ LrWpanPhy::PageSupported(uint8_t page) void LrWpanPhy::PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier id, - LrWpanPhyPibAttributes* attribute) + Ptr attribute) { NS_LOG_FUNCTION(this << id << attribute); NS_ASSERT(attribute); diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index 9e53cc392..995c715c3 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -156,7 +156,7 @@ enum LrWpanPibAttributeIdentifier * * IEEE802.15.4-2006 PHY PIB Attributes Table 23 in section 6.4.2 */ -struct LrWpanPhyPibAttributes +struct LrWpanPhyPibAttributes : public SimpleRefCount { uint8_t phyCurrentChannel; //!< The RF channel to use uint32_t phyChannelsSupported[32]; //!< BitField representing the available channels supported @@ -218,7 +218,10 @@ typedef Callback PlmeEdConfirmCallback; * @param id the identifier of attribute * @param attribute the pointer to attribute struct */ -typedef Callback +typedef Callback> PlmeGetAttributeConfirmCallback; /** @@ -395,7 +398,7 @@ class LrWpanPhy : public SpectrumPhy * \param attribute the attribute value */ void PlmeSetAttributeRequest(LrWpanPibAttributeIdentifier id, - LrWpanPhyPibAttributes* attribute); + Ptr attribute); /** * set the callback for the end of a RX, as part of the From 043199ce9defd1d7c8423699452522cdacb39b6e Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 31 Mar 2023 23:20:43 -0300 Subject: [PATCH 028/434] build: prevent collision between homonymous ns-3 modules and dependencies --- .../custom-modules/ns3-module-macros.cmake | 9 +++++++++ utils/tests/test-ns3.py | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/build-support/custom-modules/ns3-module-macros.cmake b/build-support/custom-modules/ns3-module-macros.cmake index 614639c41..1e3e38a99 100644 --- a/build-support/custom-modules/ns3-module-macros.cmake +++ b/build-support/custom-modules/ns3-module-macros.cmake @@ -144,6 +144,15 @@ function(build_lib) foreach(library ${BLIB_LIBRARIES_TO_LINK}) remove_lib_prefix("${library}" module_name) + # Ignore the case where the library dependency name match the ns-3 module + # since it is most likely is due to brite, click and openflow collisions. + # All the ns-3 module targets should be prefixed with 'lib' to be + # differentiable. + if("${library}" STREQUAL "${BLIB_LIBNAME}") + list(APPEND non_ns_libraries_to_link ${library}) + continue() + endif() + # Check if the module exists in the ns-3 modules list or if it is a # 3rd-party library if(${module_name} IN_LIST ns3-all-enabled-modules) diff --git a/utils/tests/test-ns3.py b/utils/tests/test-ns3.py index 8be19de99..e0fc56d87 100755 --- a/utils/tests/test-ns3.py +++ b/utils/tests/test-ns3.py @@ -2320,6 +2320,24 @@ class NS3BuildBaseTestCase(NS3BaseTestCase): return_code, stdout, stderr = run_program("test.py", "-p ./examples/wireless/mixed-wired-wireless", python=True) self.assertEqual(return_code, 0) + def test_13_FetchOptionalComponents(self): + """! + Test if we had regressions with brite, click and openflow modules + that depend on homonymous libraries + @return None + """ + if shutil.which("git") is None: + self.skipTest("Missing git") + + # First enable automatic components fetching + return_code, stdout, stderr = run_ns3("configure -- -DNS3_FETCH_OPTIONAL_COMPONENTS=ON") + self.assertEqual(return_code, 0) + + # Build the optional components to check if their dependencies were fetched + # and there were no build regressions + return_code, stdout, stderr = run_ns3("build brite click openflow") + self.assertEqual(return_code, 0) + class NS3ExpectedUseTestCase(NS3BaseTestCase): """! From a3777c82f3f1806bc4d89e110e641ea2a1bfb441 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Date: Thu, 30 Mar 2023 13:25:03 +0900 Subject: [PATCH 029/434] network: Add Mac16 and Mac64 functions --- CHANGES.md | 2 ++ RELEASE_NOTES.md | 1 + src/network/utils/mac16-address.cc | 10 ++++++++++ src/network/utils/mac16-address.h | 11 +++++++++-- src/network/utils/mac64-address.cc | 17 ++++++++++++++--- src/network/utils/mac64-address.h | 13 ++++++++++--- 6 files changed, 46 insertions(+), 8 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 05df6c866..4edc15746 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,8 @@ Changes from ns-3.38 to ns-3-dev * (lr-wpan) Added support for orphan scans. Orphan scans can now be performed using the existing `LrWpanMac::MlmeScanRequest`; This orphan scan use the added orphan notification commands and coordinator realigment commands. Usage is shown in added `lr-wpan-orphan-scan.cc` example and in the `TestOrphanScan` included in `lr-wpan-mac-test.cc`. * (network) Added `Mac64Address::ConvertToInt`. Converts a Mac64Address object to a uint64_t. +* (network) Added `Mac16Address::ConvertToInt`. Converts a Mac16Address object to a uint16_t. +* (network) Added `Mac16Address::Mac16Address(uint16t addr)` and `Mac16Address::Mac64Address(uint64t addr)` constructors. * (lr-wpan) Added `LrwpanMac::MlmeGetRequest` function and the corresponding confirm callbacks as well as `LrwpanMac::SetMlmeGetConfirm` function. ### Changes to existing API diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 673a914d2..c4a42664f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -23,6 +23,7 @@ Release 3-dev - (lr-wpan) !1399 - Add orphan scan support. - (network) !1405 - Add ConvertToInt to Mac64Address - (lr-wpan) !1402 - Add attributes to MLME-SET and MLME-GET +- (lr-wpan) 1410 - Add Mac16 and Mac64 functions ### Bugs fixed diff --git a/src/network/utils/mac16-address.cc b/src/network/utils/mac16-address.cc index 76f373711..f27074ae5 100644 --- a/src/network/utils/mac16-address.cc +++ b/src/network/utils/mac16-address.cc @@ -106,6 +106,7 @@ Mac16Address::Mac16Address(const char* str) Mac16Address::Mac16Address(uint16_t addr) { + NS_LOG_FUNCTION(this); m_address[1] = addr & 0xFF; m_address[0] = (addr >> 8) & 0xFF; } @@ -153,6 +154,15 @@ Mac16Address::ConvertTo() const return Address(GetType(), m_address, 2); } +uint16_t +Mac16Address::ConvertToInt() const +{ + uint16_t addr = m_address[1] & (0xFF); + addr |= (m_address[0] << 8) & (0xFF << 8); + + return addr; +} + Mac16Address Mac16Address::Allocate() { diff --git a/src/network/utils/mac16-address.h b/src/network/utils/mac16-address.h index 0d497727e..6cecc71e9 100644 --- a/src/network/utils/mac16-address.h +++ b/src/network/utils/mac16-address.h @@ -51,9 +51,9 @@ class Mac16Address Mac16Address(const char* str); /** - * \param addr The 16 bit integer used to create a Mac16Address object. + * \param addr The 16 bit unsigned integer used to create a Mac16Address object. * - * Create a Mac16Address from an 16 bit integer. + * Create a Mac16Address from an 16 bit unsigned integer. */ Mac16Address(uint16_t addr); @@ -95,6 +95,13 @@ class Mac16Address */ Address ConvertTo() const; + /** + * \return the mac address in a 16 bit unsigned integer + * + * Convert an instance of this class to a 16 bit unsigned integer. + */ + uint16_t ConvertToInt() const; + /** * \param address address to test * \returns true if the address matches, false otherwise. diff --git a/src/network/utils/mac64-address.cc b/src/network/utils/mac64-address.cc index 0818523bf..fa7863f18 100644 --- a/src/network/utils/mac64-address.cc +++ b/src/network/utils/mac64-address.cc @@ -104,6 +104,19 @@ Mac64Address::Mac64Address(const char* str) NS_ASSERT(i == 8); } +Mac64Address::Mac64Address(uint64_t addr) +{ + NS_LOG_FUNCTION(this); + m_address[7] = addr & 0xFF; + m_address[6] = (addr >> 8) & 0xFF; + m_address[5] = (addr >> 16) & 0xFF; + m_address[4] = (addr >> 24) & 0xFF; + m_address[3] = (addr >> 32) & 0xFF; + m_address[2] = (addr >> 40) & 0xFF; + m_address[1] = (addr >> 48) & 0xFF; + m_address[0] = (addr >> 56) & 0xFF; +} + void Mac64Address::CopyFrom(const uint8_t buffer[8]) { @@ -150,10 +163,8 @@ Mac64Address::ConvertTo() const uint64_t Mac64Address::ConvertToInt() const { - uint64_t addr = 0; uint64_t shift = 0xFF; - - addr = static_cast(m_address[7]) & (shift); + uint64_t addr = static_cast(m_address[7]) & (shift); addr |= (static_cast(m_address[6]) << 8) & (shift << 8); addr |= (static_cast(m_address[5]) << 16) & (shift << 16); addr |= (static_cast(m_address[4]) << 24) & (shift << 24); diff --git a/src/network/utils/mac64-address.h b/src/network/utils/mac64-address.h index 172e6a375..e1489188d 100644 --- a/src/network/utils/mac64-address.h +++ b/src/network/utils/mac64-address.h @@ -49,10 +49,17 @@ class Mac64Address /** * \param str a string representing the new Mac64Address * - * The format of the string is "xx:xx:xx:xx:xx:xx" + * The format of the string is "xx:xx:xx:xx:xx:xx:xx:xx" */ Mac64Address(const char* str); + /** + * \param addr The 64 bit unsigned integer used to create a Mac64Address object. + * + * Create a Mac64Address from an 64 bit unsigned integer. + */ + Mac64Address(uint64_t addr); + /** * \param buffer address in network order * @@ -88,9 +95,9 @@ class Mac64Address Address ConvertTo() const; /** - * \return the mac address in a 64 bit int + * \return the mac address in a 64 bit unsigned integer. * - * Convert an instance of this class to a 64 bit int. + * Convert an instance of this class to a 64 bit unsigned integer. */ uint64_t ConvertToInt() const; From 5cbd4b9c8f9b90a56ff1e8a4a3d9f6773bdfaf80 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Mon, 3 Apr 2023 17:39:17 +0900 Subject: [PATCH 030/434] lr-wpan: Added macPanId to MAC SET GET attributes --- CHANGES.md | 2 +- src/lr-wpan/model/lr-wpan-mac.cc | 12 ++++++++++-- src/lr-wpan/model/lr-wpan-mac.h | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4edc15746..56c8a6fe6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -49,7 +49,7 @@ Changes from ns-3.38 to ns-3-dev * (sixlowpan) The spelling of the function `SixLowPanNetDevice::Fragments::GetFraments` from `sixlowpan-net-device.cc` was corrected to `SixLowPanNetDevice::Fragments::GetFragments`; this will affect existing users who were using the function with the misspelling. * (lr-wpan) Updated `LrWpanPhy::PlmeSetAttribute` and `LrWpanPhy::PlmeGetAttribute` (Request and Confirm) to use smart pointers. * (lr-wpan) Modified `LrWpanPhy::PlmeGetAttributeRequest` to include support for a few attributes (none were supported before the change). -* (lr-wpan) Added `macShortAddress` and `macExtendendAddress` to the attributes that can be use with MLME-GET and MLME-SET functions. +* (lr-wpan) Added `macShortAddress`, `macExtendendAddress` and `macPanId` to the attributes that can be use with MLME-GET and MLME-SET functions. ### Changes to build system diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 2ad126fe4..56b1558ff 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -900,6 +900,8 @@ void LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, Ptr attribute) { MlmeSetConfirmParams confirmParams; + confirmParams.m_status = MLMESET_SUCCESS; + switch (id) { case macBeaconPayload: @@ -909,7 +911,6 @@ LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, PtrmacBeaconPayload; m_macBeaconPayloadLength = attribute->macBeaconPayload->GetSize(); } @@ -918,10 +919,14 @@ LrWpanMac::MlmeSetRequest(LrWpanMacPibAttributeIdentifier id, PtrmacShortAddress; + break; case macExtendedAddress: confirmParams.m_status = MLMESET_READ_ONLY; + break; + case macPanId: + m_macPanId = macPanId; + break; default: // TODO: Add support for setting other attributes confirmParams.m_status = MLMESET_UNSUPPORTED_ATTRIBUTE; @@ -955,6 +960,9 @@ LrWpanMac::MlmeGetRequest(LrWpanMacPibAttributeIdentifier id) case macExtendedAddress: attributes->macExtendedAddress = m_selfExt; break; + case macPanId: + attributes->macPanId = m_macPanId; + break; default: status = MLMEGET_UNSUPPORTED_ATTRIBUTE; break; diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index 42f0c8488..9becb4380 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -346,6 +346,7 @@ enum LrWpanMacPibAttributeIdentifier macBeaconPayloadLength = 1, macShortAddress = 2, macExtendedAddress = 3, + macPanId = 4, unsupported = 255 // TODO: complete other MAC pib attributes }; @@ -361,6 +362,7 @@ struct LrWpanMacPibAttributes : public SimpleRefCount uint8_t macBeaconPayloadLength{0}; //!< The length in octets of the beacon payload. Mac16Address macShortAddress; //!< The 16 bit mac short address Mac64Address macExtendedAddress; //!< The EUI-64 bit address + uint16_t macPanId; //!< The identifier of the PAN // TODO: complete other MAC pib attributes }; From 53ce443f790a88df9d9699088ef311ddd1d270c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 1 Feb 2023 17:48:12 +0100 Subject: [PATCH 031/434] test: Replace deprecated optparse --- src/lte/test/examples-to-run.py | 20 +-- test.py | 246 ++++++++++++++++---------------- 2 files changed, 131 insertions(+), 135 deletions(-) diff --git a/src/lte/test/examples-to-run.py b/src/lte/test/examples-to-run.py index bec96595a..6e9d3abc3 100644 --- a/src/lte/test/examples-to-run.py +++ b/src/lte/test/examples-to-run.py @@ -32,16 +32,16 @@ cpp_examples = [ ("lena-simple", "True", "True"), ("lena-simple-epc", "True", "True"), ("lena-x2-handover", "True", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TtaFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdTbfqFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdMtFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdBetFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::RrFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::PssFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::PfFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdTbfqFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdMtFfMacScheduler", "options.valgrind", "True"), - ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdBetFfMacScheduler", "options.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TtaFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdTbfqFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdMtFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::TdBetFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::RrFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::PssFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::PfFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdTbfqFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdMtFfMacScheduler", "args.valgrind", "True"), + ("lena-simple-epc --simTime=1.1 --ns3::LteHelper::Scheduler=ns3::FdBetFfMacScheduler", "args.valgrind", "True"), ("lena-ipv6-addr-conf", "True", "True"), ("lena-ipv6-ue-rh", "True", "True"), ("lena-ipv6-ue-ue", "True", "True"), diff --git a/test.py b/test.py index 94df16aa9..8c500cd71 100755 --- a/test.py +++ b/test.py @@ -19,7 +19,7 @@ import os import sys import time -import optparse +import argparse import subprocess import threading import signal @@ -623,7 +623,7 @@ def read_ns3_config(): if line.startswith(item): exec(line, globals()) - if options.verbose: + if args.verbose: for item in interesting_config_items: print("%s ==" % item, eval(item)) @@ -661,7 +661,7 @@ def make_paths(): else: os.environ["PYTHONPATH"] += ":" + pypath - if options.verbose: + if args.verbose: print("os.environ[\"PYTHONPATH\"] == %s" % os.environ["PYTHONPATH"]) if sys.platform == "darwin": @@ -669,28 +669,28 @@ def make_paths(): os.environ["DYLD_LIBRARY_PATH"] = "" for path in NS3_MODULE_PATH: os.environ["DYLD_LIBRARY_PATH"] += ":" + path - if options.verbose: + if args.verbose: print("os.environ[\"DYLD_LIBRARY_PATH\"] == %s" % os.environ["DYLD_LIBRARY_PATH"]) elif sys.platform == "win32": if not have_PATH: os.environ["PATH"] = "" for path in NS3_MODULE_PATH: os.environ["PATH"] += ';' + path - if options.verbose: + if args.verbose: print("os.environ[\"PATH\"] == %s" % os.environ["PATH"]) elif sys.platform == "cygwin": if not have_PATH: os.environ["PATH"] = "" for path in NS3_MODULE_PATH: os.environ["PATH"] += ":" + path - if options.verbose: + if args.verbose: print("os.environ[\"PATH\"] == %s" % os.environ["PATH"]) else: if not have_LD_LIBRARY_PATH: os.environ["LD_LIBRARY_PATH"] = "" for path in NS3_MODULE_PATH: os.environ["LD_LIBRARY_PATH"] += ":" + str(path) - if options.verbose: + if args.verbose: print("os.environ[\"LD_LIBRARY_PATH\"] == %s" % os.environ["LD_LIBRARY_PATH"]) # @@ -801,7 +801,7 @@ def run_job_synchronously(shell_command, directory, valgrind, is_python, build_p else: cmd = path_cmd - if options.verbose: + if args.verbose: print("Synchronously execute %s" % cmd) start_time = time.time() @@ -833,7 +833,7 @@ def run_job_synchronously(shell_command, directory, valgrind, is_python, build_p stdout_results = decode_stream_results(stdout_results, "stdout") stderr_results = decode_stream_results(stderr_results, "stderr") - if options.verbose: + if args.verbose: print("Return code = ", retval) print("stderr = ", stderr_results) @@ -1009,7 +1009,7 @@ class worker_thread(threading.Thread): # if is_skip is true, returncode is undefined. # if job.is_skip: - if options.verbose: + if args.verbose: print("Skip %s" % job.shell_command) self.output_queue.put(job) continue @@ -1018,7 +1018,7 @@ class worker_thread(threading.Thread): # Otherwise go about the business of running tests as normal. # else: - if options.verbose: + if args.verbose: print("Launch %s" % job.shell_command) if job.is_example or job.is_pyexample: @@ -1028,24 +1028,24 @@ class worker_thread(threading.Thread): # "examples/wireless/mixed-wireless.py" # (job.returncode, standard_out, standard_err, et) = run_job_synchronously(job.shell_command, - job.cwd, options.valgrind, job.is_pyexample, job.build_path) + job.cwd, args.valgrind, job.is_pyexample, job.build_path) else: # # If we're a test suite, we need to provide a little more info # to the test runner, specifically the base directory and temp # file name # - if options.update_data: + if args.update_data: update_data = '--update-data' else: update_data = '' (job.returncode, standard_out, standard_err, et) = run_job_synchronously(job.shell_command + " --xml --tempdir=%s --out=%s %s" % (job.tempdir, job.tmp_file_name, update_data), - job.cwd, options.valgrind, False) + job.cwd, args.valgrind, False) job.set_elapsed_time(et) - if options.verbose: + if args.verbose: print("returncode = %d" % job.returncode) print("---------- begin standard out ----------") print(standard_out) @@ -1090,7 +1090,7 @@ def run_tests(): # our users pain while waiting for extraneous stuff to compile and link, so # we allow users that know what they're doing to not invoke ns3 at all. # - if not options.no_build: + if not args.no_build: # If the user only wants to run a single example, then we can just build # that example. @@ -1098,15 +1098,15 @@ def run_tests(): # If there is no constraint, then we have to build everything since the # user wants to run everything. # - if len(options.example): - build_cmd = "./ns3 build %s" % os.path.basename(options.example) + if len(args.example): + build_cmd = "./ns3 build %s" % os.path.basename(args.example) else: build_cmd = "./ns3" if sys.platform == "win32": build_cmd = sys.executable + " " + build_cmd - if options.verbose: + if args.verbose: print("Building: %s" % build_cmd) proc = subprocess.run(build_cmd, shell=True) @@ -1216,16 +1216,16 @@ def run_tests(): # up a bunch of threads and running tests. Let's detect these cases and # handle them without doing all of the hard work. # - if options.kinds: + if args.kinds: path_cmd = os.path.join("utils", test_runner_name + " --print-test-type-list") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) print(standard_out) - if options.list: + if args.list: list_items = [] if ENABLE_TESTS: - if len(options.constrain): - path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --print-test-types --test-type=%s" % options.constrain) + if len(args.constrain): + path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --print-test-types --test-type=%s" % args.constrain) else: path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --print-test-types") (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) @@ -1258,7 +1258,7 @@ def run_tests(): print("example ", item) print() - if options.kinds or options.list: + if args.kinds or args.list: return # @@ -1326,7 +1326,7 @@ def run_tests(): # Flag indicating a specific suite was explicitly requested single_suite = False - if len(options.suite): + if len(args.suite): # See if this is a valid test suite. path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list") (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) @@ -1334,7 +1334,7 @@ def run_tests(): if isinstance(suites, bytes): suites = suites.decode() - suites_found = fnmatch.filter(suites.split('\n'), options.suite) + suites_found = fnmatch.filter(suites.split('\n'), args.suite) if not suites_found: print('The test suite was not run because an unknown test suite name was requested.', file=sys.stderr) @@ -1344,9 +1344,9 @@ def run_tests(): suites = '\n'.join(suites_found) - elif ENABLE_TESTS and len(options.example) == 0 and len(options.pyexample) == 0: - if len(options.constrain): - path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --test-type=%s" % options.constrain) + elif ENABLE_TESTS and len(args.example) == 0 and len(args.pyexample) == 0: + if len(args.constrain): + path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --test-type=%s" % args.constrain) (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False) else: path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list") @@ -1371,7 +1371,7 @@ def run_tests(): # i.e. they are not run by default in test.py. # If a specific suite was requested we run it, even if # it is a performance test. - if not single_suite and options.constrain != 'performance': + if not single_suite and args.constrain != 'performance': # Get a list of all of the performance tests. path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --test-type=%s" % "performance") @@ -1414,11 +1414,11 @@ def run_tests(): else: processors = os.cpu_count() - if (options.process_limit): - if (processors < options.process_limit): + if args.process_limit: + if processors < args.process_limit: print('Using all %s processors' % processors) else: - processors = options.process_limit + processors = args.process_limit print('Limiting to %s worker processes' % processors) # @@ -1458,12 +1458,12 @@ def run_tests(): job.set_cwd(os.getcwd()) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) - if (options.multiple): + if args.multiple: multiple = "" else: multiple = " --stop-on-failure" - if (len(options.fullness)): - fullness = options.fullness.upper() + if len(args.fullness): + fullness = args.fullness.upper() fullness = " --fullness=%s" % fullness else: fullness = " --fullness=QUICK" @@ -1472,11 +1472,11 @@ def run_tests(): job.set_shell_command(path_cmd) - if options.valgrind and test in core_valgrind_skip_tests: + if args.valgrind and test in core_valgrind_skip_tests: job.set_is_skip(True) job.set_skip_reason("crashes valgrind") - if options.verbose: + if args.verbose: print("Queue %s" % test) input_queue.put(job) @@ -1515,8 +1515,8 @@ def run_tests(): # ./test.py --suite=some-suite --example=some-example: run the single example # # - if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: - if len(options.constrain) == 0 or options.constrain == "example": + if len(args.suite) == 0 and len(args.example) == 0 and len(args.pyexample) == 0: + if len(args.constrain) == 0 or args.constrain == "example": if ENABLE_EXAMPLES: for name, test, do_run, do_valgrind_run in example_tests: # Remove any arguments and directory names from test. @@ -1536,23 +1536,23 @@ def run_tests(): job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command(test) - job.set_build_path(options.buildpath) + job.set_build_path(args.buildpath) - if options.valgrind and not eval(do_valgrind_run): + if args.valgrind and not eval(do_valgrind_run): job.set_is_skip(True) job.set_skip_reason("skip in valgrind runs") - if options.verbose: + if args.verbose: print("Queue %s" % test) input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 - elif len(options.example): + elif len(args.example): # Add the proper prefix and suffix to the example name to # match what is done in the CMakeLists.txt file. - example_name = "%s%s-%s%s" % (APPNAME, VERSION, options.example, BUILD_PROFILE_SUFFIX) + example_name = "%s%s-%s%s" % (APPNAME, VERSION, args.example, BUILD_PROFILE_SUFFIX) key_list = [] for key in ns3_runnable_programs_dictionary: @@ -1560,7 +1560,7 @@ def run_tests(): example_name_key_list = fnmatch.filter(key_list, example_name) if len(example_name_key_list) == 0: - print("No example matching the name %s" % options.example) + print("No example matching the name %s" % args.example) else: # # If you tell me to run an example, I will try and run the example @@ -1578,9 +1578,9 @@ def run_tests(): job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) job.set_shell_command(example_path) - job.set_build_path(options.buildpath) + job.set_build_path(args.buildpath) - if options.verbose: + if args.verbose: print("Queue %s" % example_name_iter) input_queue.put(job) @@ -1607,8 +1607,8 @@ def run_tests(): # ./test.py --constrain=pyexample run all of the python examples # ./test.py --pyexample=some-example.py: run the single python example # - if len(options.suite) == 0 and len(options.example) == 0 and len(options.pyexample) == 0: - if len(options.constrain) == 0 or options.constrain == "pyexample": + if len(args.suite) == 0 and len(args.example) == 0 and len(args.pyexample) == 0: + if len(args.constrain) == 0 or args.constrain == "pyexample": for test, do_run in python_tests: # Remove any arguments and directory names from test. test_name = test.split(' ', 1)[0] @@ -1635,7 +1635,7 @@ def run_tests(): # work to report the skipped tests in a consistent # way through the output formatter. # - if options.valgrind: + if args.valgrind: job.set_is_skip(True) job.set_skip_reason("skip in valgrind runs") @@ -1648,26 +1648,26 @@ def run_tests(): job.set_is_skip(True) job.set_skip_reason("requires Python bindings") - if options.verbose: + if args.verbose: print("Queue %s" % test) input_queue.put(job) jobs = jobs + 1 total_tests = total_tests + 1 - elif len(options.pyexample): + elif len(args.pyexample): # Find the full relative path to file if only a partial path has been given. - if not os.path.exists(options.pyexample): + if not os.path.exists(args.pyexample): import glob - files = glob.glob("./**/%s" % options.pyexample, recursive=True) + files = glob.glob("./**/%s" % args.pyexample, recursive=True) if files: - options.pyexample = files[0] + args.pyexample = files[0] # Don't try to run this example if it isn't runnable. - example_name = os.path.basename(options.pyexample) + example_name = os.path.basename(args.pyexample) if example_name not in ns3_runnable_scripts: print("Example %s is not runnable." % example_name) - elif not os.path.exists(options.pyexample): + elif not os.path.exists(args.pyexample): print("Example %s does not exist." % example_name) else: # @@ -1676,16 +1676,16 @@ def run_tests(): # job = Job() job.set_is_pyexample(True) - job.set_display_name(options.pyexample) + job.set_display_name(args.pyexample) job.set_tmp_file_name("") job.set_cwd(testpy_output_dir) job.set_basedir(os.getcwd()) job.set_tempdir(testpy_output_dir) - job.set_shell_command(options.pyexample) + job.set_shell_command(args.pyexample) job.set_build_path("") - if options.verbose: - print("Queue %s" % options.pyexample) + if args.verbose: + print("Queue %s" % args.pyexample) input_queue.put(job) jobs = jobs + 1 @@ -1754,7 +1754,7 @@ def run_tests(): status_print = colors.PINK + status + colors.NORMAL print("[%d/%d]" % (passed_tests + failed_tests + skipped_tests + crashed_tests, total_tests), end=' ') - if options.duration or options.constrain == "performance": + if args.duration or args.constrain == "performance": print("%s (%.3f): %s %s" % (status_print, job.elapsed_time, kind, job.display_name)) else: print("%s: %s %s" % (status_print, kind, job.display_name)) @@ -1892,17 +1892,17 @@ def run_tests(): # The last things to do are to translate the XML results file to "human # readable form" if the user asked for it (or make an XML file somewhere) # - if len(options.html) + len(options.text) + len(options.xml): + if len(args.html) + len(args.text) + len(args.xml): print() - if len(options.html): - translate_to_html(xml_results_file, options.html) + if len(args.html): + translate_to_html(xml_results_file, args.html) - if len(options.text): - translate_to_text(xml_results_file, options.text) + if len(args.text): + translate_to_text(xml_results_file, args.text) - if len(options.xml): - xml_file = options.xml + '.xml' + if len(args.xml): + xml_file = args.xml + '.xml' print('Writing results to xml file %s...' % xml_file, end='') shutil.copyfile(xml_results_file, xml_file) print('done.') @@ -1925,7 +1925,7 @@ def run_tests(): # Let the user know if they tried to use valgrind but it was not # present on their machine. # - if options.valgrind and not VALGRIND_FOUND: + if args.valgrind and not VALGRIND_FOUND: print() print('*** Note: you are trying to use valgrind, but valgrind could not be found') print('*** on your machine. All tests and examples will crash or be skipped.') @@ -1937,7 +1937,7 @@ def run_tests(): # directory we just created. We don't want to happily delete any retained # directories, which will probably surprise the user. # - if not options.retain: + if not args.retain: shutil.rmtree(testpy_output_dir) if passed_tests + skipped_tests == total_tests: @@ -1946,83 +1946,79 @@ def run_tests(): return 1 # catchall for general errors def main(argv): - parser = optparse.OptionParser() - parser.add_option("-b", "--buildpath", action="store", type="string", dest="buildpath", default="", - metavar="BUILDPATH", - help="specify the path where ns-3 was built (defaults to the build directory for the current variant)") + parser = argparse.ArgumentParser() + parser.add_argument("-b", "--buildpath", action="store", type=str, default="", + help="specify the path where ns-3 was built (defaults to the build directory for the current variant)") - parser.add_option("-c", "--constrain", action="store", type="string", dest="constrain", default="", - metavar="KIND", - help="constrain the test-runner by kind of test") + parser.add_argument("-c", "--constrain", action="store", type=str, default="", + help="constrain the test-runner by kind of test") - parser.add_option("-d", "--duration", action="store_true", dest="duration", default=False, - help="print the duration of each test suite and example") + parser.add_argument("-d", "--duration", action="store_true", default=False, + help="print the duration of each test suite and example") - parser.add_option("-e", "--example", action="store", type="string", dest="example", default="", - metavar="EXAMPLE", - help="specify a single example to run (no relative path is needed)") + parser.add_argument("-e", "--example", action="store", type=str, default="", + help="specify a single example to run (no relative path is needed)") - parser.add_option("-u", "--update-data", action="store_true", dest="update_data", default=False, - help="If examples use reference data files, get them to re-generate them") + parser.add_argument("-u", "--update-data", action="store_true", default=False, + help="If examples use reference data files, get them to re-generate them") - parser.add_option("-f", "--fullness", action="store", type="choice", dest="fullness", default="QUICK", - metavar="FULLNESS", choices=["QUICK", "EXTENSIVE", "TAKES_FOREVER"], - help="choose the duration of tests to run: QUICK, EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE includes QUICK and TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK tests are run by default)") + parser.add_argument("-f", "--fullness", action="store", type=str, default="QUICK", + choices=["QUICK", "EXTENSIVE", "TAKES_FOREVER"], + help="choose the duration of tests to run: QUICK, EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE includes QUICK and TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK tests are run by default)") - parser.add_option("-g", "--grind", action="store_true", dest="valgrind", default=False, - help="run the test suites and examples using valgrind") + parser.add_argument("-g", "--grind", action="store_true", dest="valgrind", default=False, + help="run the test suites and examples using valgrind") - parser.add_option("-k", "--kinds", action="store_true", dest="kinds", default=False, - help="print the kinds of tests available") + parser.add_argument("-k", "--kinds", action="store_true", default=False, + help="print the kinds of tests available") - parser.add_option("-l", "--list", action="store_true", dest="list", default=False, - help="print the list of known tests") + parser.add_argument("-l", "--list", action="store_true", default=False, + help="print the list of known tests") - parser.add_option("-m", "--multiple", action="store_true", dest="multiple", default=False, - help="report multiple failures from test suites and test cases") + parser.add_argument("-m", "--multiple", action="store_true", default=False, + help="report multiple failures from test suites and test cases") - parser.add_option("-n", "--no-build", action="store_true", dest="no_build", default=False, - help="do not build before starting testing") + parser.add_argument("-n", "--no-build", action="store_true", default=False, + help="do not build before starting testing") - parser.add_option("-p", "--pyexample", action="store", type="string", dest="pyexample", default="", - metavar="PYEXAMPLE", - help="specify a single python example to run (with relative path)") + parser.add_argument("-p", "--pyexample", action="store", type=str, default="", + help="specify a single python example to run (with relative path)") - parser.add_option("-r", "--retain", action="store_true", dest="retain", default=False, - help="retain all temporary files (which are normally deleted)") + parser.add_argument("-r", "--retain", action="store_true", default=False, + help="retain all temporary files (which are normally deleted)") - parser.add_option("-s", "--suite", action="store", type="string", dest="suite", default="", - metavar="TEST-SUITE", - help="specify a single test suite to run") + parser.add_argument("-s", "--suite", action="store", type=str, default="", + help="specify a single test suite to run") - parser.add_option("-t", "--text", action="store", type="string", dest="text", default="", - metavar="TEXT-FILE", - help="write detailed test results into TEXT-FILE.txt") + parser.add_argument("-t", "--text", action="store", type=str, default="", + metavar="TEXT-FILE", + help="write detailed test results into TEXT-FILE.txt") - parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, - help="print progress and informational messages") + parser.add_argument("-v", "--verbose", action="store_true", default=False, + help="print progress and informational messages") - parser.add_option("-w", "--web", "--html", action="store", type="string", dest="html", default="", - metavar="HTML-FILE", - help="write detailed test results into HTML-FILE.html") + parser.add_argument("-w", "--web", "--html", action="store", type=str, dest="html", default="", + metavar="HTML-FILE", + help="write detailed test results into HTML-FILE.html") - parser.add_option("-x", "--xml", action="store", type="string", dest="xml", default="", - metavar="XML-FILE", - help="write detailed test results into XML-FILE.xml") + parser.add_argument("-x", "--xml", action="store", type=str, default="", + metavar="XML-FILE", + help="write detailed test results into XML-FILE.xml") - parser.add_option("--nocolor", action="store_true", dest="nocolor", default=False, - help="do not use colors in the standard output") - parser.add_option("--jobs", action="store", type="int", dest="process_limit", default=0, - help="limit number of worker threads") + parser.add_argument("--nocolor", action="store_true", default=False, + help="do not use colors in the standard output") - global options - options = parser.parse_args()[0] + parser.add_argument("--jobs", action="store", type=int, dest="process_limit", default=0, + help="limit number of worker threads") + + global args + args = parser.parse_args() signal.signal(signal.SIGINT, sigint_hook) # From waf/waflib/Options.py envcolor=os.environ.get('NOCOLOR','') and 'no' or 'auto' or 'yes' - if options.nocolor or envcolor == 'no': + if args.nocolor or envcolor == 'no': colors_lst['USE'] = False return run_tests() From 5fc249a99132c71ebefcfda312cf8cf4e5bc85b8 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Tue, 4 Apr 2023 07:53:50 +0000 Subject: [PATCH 032/434] internet: refactor how headers are built during fragmentation --- src/internet/model/ipv6-extension.cc | 52 ++++++++++++++++++++++------ src/internet/model/ipv6-extension.h | 18 ++++++++++ 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/internet/model/ipv6-extension.cc b/src/internet/model/ipv6-extension.cc index 81223c1bb..575e92d61 100644 --- a/src/internet/model/ipv6-extension.cc +++ b/src/internet/model/ipv6-extension.cc @@ -513,11 +513,16 @@ Ipv6ExtensionFragment::GetFragments(Ptr packet, } else if (nextHeader == Ipv6Header::IPV6_EXT_ROUTING) { - uint8_t buf[2]; + Ptr ipv6ExtensionRoutingDemux = + GetNode()->GetObject(); + + uint8_t buf[4]; p->CopyData(buf, sizeof(buf)); - uint8_t numberAddress = buf[1] / 2; - Ipv6ExtensionLooseRoutingHeader* routingHeader = new Ipv6ExtensionLooseRoutingHeader(); - routingHeader->SetNumberAddress(numberAddress); + uint8_t routingType = buf[2]; + + Ipv6ExtensionRoutingHeader* routingHeader = + ipv6ExtensionRoutingDemux->GetExtensionRoutingHeaderPtr(routingType); + p->RemoveHeader(*routingHeader); nextHeader = routingHeader->GetNextHeader(); @@ -885,6 +890,12 @@ Ipv6ExtensionRouting::GetTypeRouting() const return 0; } +Ipv6ExtensionRoutingHeader* +Ipv6ExtensionRouting::GetExtensionRoutingHeaderPtr() +{ + return nullptr; +} + uint8_t Ipv6ExtensionRouting::Process(Ptr& packet, uint8_t offset, @@ -1014,15 +1025,30 @@ Ipv6ExtensionRoutingDemux::Insert(Ptr extensionRouting) Ptr Ipv6ExtensionRoutingDemux::GetExtensionRouting(uint8_t typeRouting) { - for (Ipv6ExtensionRoutingList_t::iterator i = m_extensionsRouting.begin(); - i != m_extensionsRouting.end(); - i++) + for (const auto& extRouting : m_extensionsRouting) { - if ((*i)->GetTypeRouting() == typeRouting) + if (extRouting->GetTypeRouting() == typeRouting) { - return *i; + return extRouting; } } + + return nullptr; +} + +Ipv6ExtensionRoutingHeader* +Ipv6ExtensionRoutingDemux::GetExtensionRoutingHeaderPtr(uint8_t typeRouting) +{ + NS_LOG_FUNCTION(this << typeRouting); + + for (const auto& extRouting : m_extensionsRouting) + { + if (extRouting->GetTypeRouting() == typeRouting) + { + return extRouting->GetExtensionRoutingHeaderPtr(); + } + } + return nullptr; } @@ -1059,6 +1085,12 @@ Ipv6ExtensionLooseRouting::GetTypeRouting() const return TYPE_ROUTING; } +Ipv6ExtensionRoutingHeader* +Ipv6ExtensionLooseRouting::GetExtensionRoutingHeaderPtr() +{ + return new Ipv6ExtensionLooseRoutingHeader(); +} + uint8_t Ipv6ExtensionLooseRouting::Process(Ptr& packet, uint8_t offset, @@ -1089,9 +1121,7 @@ Ipv6ExtensionLooseRouting::Process(Ptr& packet, // Get the number of routers' address field uint8_t buf[2]; p->CopyData(buf, sizeof(buf)); - uint8_t numberAddress = buf[1] / 2; Ipv6ExtensionLooseRoutingHeader routingHeader; - routingHeader.SetNumberAddress(numberAddress); p->RemoveHeader(routingHeader); if (nextHeader) diff --git a/src/internet/model/ipv6-extension.h b/src/internet/model/ipv6-extension.h index e06e83b2a..5c6af5b64 100644 --- a/src/internet/model/ipv6-extension.h +++ b/src/internet/model/ipv6-extension.h @@ -20,6 +20,7 @@ #ifndef IPV6_EXTENSION_H #define IPV6_EXTENSION_H +#include "ipv6-extension-header.h" #include "ipv6-interface.h" #include "ns3/buffer.h" @@ -515,6 +516,13 @@ class Ipv6ExtensionRouting : public Ipv6Extension */ virtual uint8_t GetTypeRouting() const; + /** + * \brief Get a pointer to a new routing extension header. + * The ownership is transferred to the caller. + * \return a pointer to a new routing extension header. + */ + virtual Ipv6ExtensionRoutingHeader* GetExtensionRoutingHeaderPtr(); + uint8_t Process(Ptr& packet, uint8_t offset, const Ipv6Header& ipv6Header, @@ -568,6 +576,14 @@ class Ipv6ExtensionRoutingDemux : public Object */ Ptr GetExtensionRouting(uint8_t typeRouting); + /** + * \brief Get a pointer to a new routing extension header corresponding + * to typeRouting. The ownership is transferred to the caller. + * \param typeRouting the number of the routing extension to retrieve + * \return a pointer to a new routing extension header matching IPv6 routing extension + */ + Ipv6ExtensionRoutingHeader* GetExtensionRoutingHeaderPtr(uint8_t typeRouting); + /** * \brief Remove a routing extension from this demux. * \param extensionRouting pointer on the extension to remove @@ -632,6 +648,8 @@ class Ipv6ExtensionLooseRouting : public Ipv6ExtensionRouting */ uint8_t GetTypeRouting() const override; + Ipv6ExtensionRoutingHeader* GetExtensionRoutingHeaderPtr() override; + uint8_t Process(Ptr& packet, uint8_t offset, const Ipv6Header& ipv6Header, From a133d4c04d5e01dded8d027e0661124bf8644894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 7 Mar 2023 20:28:41 +0100 Subject: [PATCH 033/434] wifi: Add missing operators to WifiPhyOperatingChannel --- src/wifi/model/wifi-default-assoc-manager.cc | 11 ++----- src/wifi/model/wifi-phy-operating-channel.cc | 27 ++++++++++++++++++ src/wifi/model/wifi-phy-operating-channel.h | 30 ++++++++++++++++++++ 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/wifi/model/wifi-default-assoc-manager.cc b/src/wifi/model/wifi-default-assoc-manager.cc index c3bfab14f..d2628ef16 100644 --- a/src/wifi/model/wifi-default-assoc-manager.cc +++ b/src/wifi/model/wifi-default-assoc-manager.cc @@ -180,10 +180,7 @@ WifiDefaultAssocManager::EndScanning() } bool needChannelSwitch = false; - if (const auto& channel = phy->GetOperatingChannel(); - channel.GetNumber() != apChannel.GetNumber() || - channel.GetWidth() != apChannel.GetWidth() || - channel.GetPhyBand() != apChannel.GetPhyBand()) + if (phy->GetOperatingChannel() != apChannel) { needChannelSwitch = true; } @@ -218,11 +215,7 @@ WifiDefaultAssocManager::EndScanning() } // switch this link to using the channel used by a reported AP // TODO check if the STA only supports a narrower channel width - NS_LOG_DEBUG("Switch link " - << +linkId << " to using channel " << +apChannel.GetNumber() - << " in band " << apChannel.GetPhyBand() << " frequency " - << apChannel.GetFrequency() << "MHz width " << apChannel.GetWidth() - << "MHz"); + NS_LOG_DEBUG("Switch link " << +linkId << " to using " << apChannel); WifiPhy::ChannelTuple chTuple{apChannel.GetNumber(), apChannel.GetWidth(), apChannel.GetPhyBand(), diff --git a/src/wifi/model/wifi-phy-operating-channel.cc b/src/wifi/model/wifi-phy-operating-channel.cc index 3c211cd6e..8a38706e3 100644 --- a/src/wifi/model/wifi-phy-operating-channel.cc +++ b/src/wifi/model/wifi-phy-operating-channel.cc @@ -695,4 +695,31 @@ WifiPhyOperatingChannel::Get20MHzIndicesCoveringRu(HeRu::RuSpec ru, uint16_t wid return indices; } +bool +WifiPhyOperatingChannel::operator==(const WifiPhyOperatingChannel& other) const +{ + return m_channelIt == other.m_channelIt; +} + +bool +WifiPhyOperatingChannel::operator!=(const WifiPhyOperatingChannel& other) const +{ + return !(*this == other); +} + +std::ostream& +operator<<(std::ostream& os, const WifiPhyOperatingChannel& channel) +{ + if (channel.IsSet()) + { + os << "channel " << +channel.GetNumber() << " in band " << channel.GetPhyBand() + << " frequency " << channel.GetFrequency() << " width " << channel.GetWidth(); + } + else + { + os << "channel not set"; + } + return os; +} + } // namespace ns3 diff --git a/src/wifi/model/wifi-phy-operating-channel.h b/src/wifi/model/wifi-phy-operating-channel.h index 02be06711..1fcb33c65 100644 --- a/src/wifi/model/wifi-phy-operating-channel.h +++ b/src/wifi/model/wifi-phy-operating-channel.h @@ -64,6 +64,27 @@ class WifiPhyOperatingChannel virtual ~WifiPhyOperatingChannel(); + /** + * Check if the given WifiPhyOperatingChannel is equivalent. + * Note that the primary20 channels are not compared. + * + * \param other another WifiPhyOperatingChannel + * + * \return true if the given WifiPhyOperatingChannel is equivalent, + * false otherwise + */ + bool operator==(const WifiPhyOperatingChannel& other) const; + + /** + * Check if the given WifiPhyOperatingChannel is different. + * + * \param other another WifiPhyOperatingChannel + * + * \return true if the given WifiPhyOperatingChannel is different, + * false otherwise + */ + bool operator!=(const WifiPhyOperatingChannel& other) const; + static const std::set m_frequencyChannels; //!< Available frequency channels @@ -281,6 +302,15 @@ class WifiPhyOperatingChannel subchannel with the lowest center frequency) */ }; +/** + * \brief Stream insertion operator. + * + * \param os the stream + * \param channel the operating channel + * \returns a reference to the stream + */ +std::ostream& operator<<(std::ostream& os, const WifiPhyOperatingChannel& channel); + } // namespace ns3 #endif /* WIFI_PHY_OPERATING_CHANNEL_H */ From db2be4a9d9359eb7554224ea6a36c51a7dc68ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Thu, 23 Mar 2023 19:01:43 +0100 Subject: [PATCH 034/434] wifi: Pass operating channel to WifiPpdu --- src/wifi/model/eht/eht-phy.cc | 4 +- src/wifi/model/eht/eht-ppdu.cc | 9 +- src/wifi/model/eht/eht-ppdu.h | 6 +- src/wifi/model/he/he-phy.cc | 4 +- src/wifi/model/he/he-ppdu.cc | 27 +++-- src/wifi/model/he/he-ppdu.h | 12 +- src/wifi/model/ht/ht-phy.cc | 4 +- src/wifi/model/ht/ht-ppdu.cc | 16 +-- src/wifi/model/ht/ht-ppdu.h | 6 +- src/wifi/model/interference-helper.cc | 6 +- src/wifi/model/non-ht/dsss-phy.cc | 3 +- src/wifi/model/non-ht/dsss-ppdu.cc | 7 +- src/wifi/model/non-ht/dsss-ppdu.h | 4 +- src/wifi/model/non-ht/erp-ofdm-phy.cc | 4 +- src/wifi/model/non-ht/erp-ofdm-ppdu.cc | 8 +- src/wifi/model/non-ht/erp-ofdm-ppdu.h | 6 +- src/wifi/model/non-ht/ofdm-phy.cc | 4 +- src/wifi/model/non-ht/ofdm-ppdu.cc | 12 +- src/wifi/model/non-ht/ofdm-ppdu.h | 7 +- src/wifi/model/phy-entity.cc | 3 +- src/wifi/model/vht/vht-phy.cc | 4 +- src/wifi/model/vht/vht-ppdu.cc | 9 +- src/wifi/model/vht/vht-ppdu.h | 7 +- src/wifi/model/wifi-ppdu.cc | 19 +++- src/wifi/model/wifi-ppdu.h | 10 +- src/wifi/test/spectrum-wifi-phy-test.cc | 32 ++++-- src/wifi/test/wifi-phy-cca-test.cc | 102 ++++++++--------- src/wifi/test/wifi-phy-ofdma-test.cc | 3 +- src/wifi/test/wifi-phy-reception-test.cc | 128 +++++++++++++--------- src/wifi/test/wifi-phy-thresholds-test.cc | 30 +++-- 30 files changed, 252 insertions(+), 244 deletions(-) diff --git a/src/wifi/model/eht/eht-phy.cc b/src/wifi/model/eht/eht-phy.cc index 324472b2d..fe8a87765 100644 --- a/src/wifi/model/eht/eht-phy.cc +++ b/src/wifi/model/eht/eht-phy.cc @@ -160,10 +160,8 @@ EhtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, T NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration); return Create(psdus, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), + m_wifiPhy->GetOperatingChannel(), ppduDuration, - m_wifiPhy->GetPhyBand(), ObtainNextUid(txVector), HePpdu::PSD_NON_HE_PORTION); } diff --git a/src/wifi/model/eht/eht-ppdu.cc b/src/wifi/model/eht/eht-ppdu.cc index d441c6d97..4ba40737b 100644 --- a/src/wifi/model/eht/eht-ppdu.cc +++ b/src/wifi/model/eht/eht-ppdu.cc @@ -22,6 +22,7 @@ #include "eht-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-psdu.h" namespace ns3 @@ -31,15 +32,13 @@ NS_LOG_COMPONENT_DEFINE("EhtPpdu"); EhtPpdu::EhtPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid, TxPsdFlag flag) - : HePpdu(psdus, txVector, txCenterFreq, ppduDuration, band, uid, flag) + : HePpdu(psdus, txVector, channel, ppduDuration, uid, flag) { - NS_LOG_FUNCTION(this << psdus << txVector << txCenterFreq << ppduDuration << band << uid - << flag); + NS_LOG_FUNCTION(this << psdus << txVector << channel << ppduDuration << uid << flag); // For EHT SU transmissions (carried in EHT MU PPDUs), we have to: // - store the EHT-SIG content channels diff --git a/src/wifi/model/eht/eht-ppdu.h b/src/wifi/model/eht/eht-ppdu.h index 15d61ef13..d0f7f464d 100644 --- a/src/wifi/model/eht/eht-ppdu.h +++ b/src/wifi/model/eht/eht-ppdu.h @@ -47,17 +47,15 @@ class EhtPpdu : public HePpdu * * \param psdus the PHY payloads (PSDUs) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU * \param uid the unique ID of this PPDU or of the triggering PPDU if this is an EHT TB PPDU * \param flag the flag indicating the type of Tx PSD to build */ EhtPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid, TxPsdFlag flag); diff --git a/src/wifi/model/he/he-phy.cc b/src/wifi/model/he/he-phy.cc index baed855cb..5a2f7c917 100644 --- a/src/wifi/model/he/he-phy.cc +++ b/src/wifi/model/he/he-phy.cc @@ -339,10 +339,8 @@ HePhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, Ti NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration); return Create(psdus, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), + m_wifiPhy->GetOperatingChannel(), ppduDuration, - m_wifiPhy->GetPhyBand(), ObtainNextUid(txVector), HePpdu::PSD_NON_HE_PORTION); } diff --git a/src/wifi/model/he/he-ppdu.cc b/src/wifi/model/he/he-ppdu.cc index c655dd95d..621a9359a 100644 --- a/src/wifi/model/he/he-ppdu.cc +++ b/src/wifi/model/he/he-ppdu.cc @@ -24,6 +24,7 @@ #include "he-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-psdu.h" #include "ns3/wifi-utils.h" @@ -50,20 +51,18 @@ operator<<(std::ostream& os, const HePpdu::TxPsdFlag& flag) HePpdu::HePpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid, TxPsdFlag flag) : OfdmPpdu(psdus.begin()->second, txVector, - txCenterFreq, - band, + channel, uid, - false) // don't instantiate LSigHeader of OfdmPpdu + false), // don't instantiate LSigHeader of OfdmPpdu + m_txPsdFlag(flag) { - NS_LOG_FUNCTION(this << psdus << txVector << txCenterFreq << ppduDuration << band << uid - << flag); + NS_LOG_FUNCTION(this << psdus << txVector << channel << ppduDuration << uid << flag); // overwrite with map (since only first element used by OfdmPpdu) m_psdus.begin()->second = nullptr; @@ -85,18 +84,16 @@ HePpdu::HePpdu(const WifiConstPsduMap& psdus, HePpdu::HePpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid) : OfdmPpdu(psdu, txVector, - txCenterFreq, - band, + channel, uid, false) // don't instantiate LSigHeader of OfdmPpdu { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << ppduDuration << band << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << ppduDuration << uid); NS_ASSERT(!IsMu()); SetPhyHeaders(txVector, ppduDuration); SetTxPsdFlag(PSD_NON_HE_PORTION); @@ -126,7 +123,8 @@ void HePpdu::SetLSigHeader(LSigHeader& lSig, Time ppduDuration) const { uint8_t sigExtension = 0; - if (m_band == WIFI_PHY_BAND_2_4GHZ) + NS_ASSERT(m_operatingChannel.IsSet()); + if (m_operatingChannel.GetPhyBand() == WIFI_PHY_BAND_2_4GHZ) { sigExtension = 6; } @@ -240,7 +238,8 @@ HePpdu::GetTxDuration() const Time tSymbol = NanoSeconds(12800 + txVector.GetGuardInterval()); Time preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration(txVector); uint8_t sigExtension = 0; - if (m_band == WIFI_PHY_BAND_2_4GHZ) + NS_ASSERT(m_operatingChannel.IsSet()); + if (m_operatingChannel.GetPhyBand() == WIFI_PHY_BAND_2_4GHZ) { sigExtension = 6; } diff --git a/src/wifi/model/he/he-ppdu.h b/src/wifi/model/he/he-ppdu.h index 082f1d6b9..de316d707 100644 --- a/src/wifi/model/he/he-ppdu.h +++ b/src/wifi/model/he/he-ppdu.h @@ -163,16 +163,14 @@ class HePpdu : public OfdmPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU * \param uid the unique ID of this PPDU */ HePpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid); /** * Create an MU HE PPDU, storing a map of PSDUs. @@ -181,17 +179,15 @@ class HePpdu : public OfdmPpdu * * \param psdus the PHY payloads (PSDUs) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU * \param uid the unique ID of this PPDU or of the triggering PPDU if this is an HE TB PPDU * \param flag the flag indicating the type of Tx PSD to build */ HePpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid, TxPsdFlag flag); diff --git a/src/wifi/model/ht/ht-phy.cc b/src/wifi/model/ht/ht-phy.cc index f28bcfa73..dfa742544 100644 --- a/src/wifi/model/ht/ht-phy.cc +++ b/src/wifi/model/ht/ht-phy.cc @@ -381,10 +381,8 @@ HtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, Ti NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration); return Create(psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), + m_wifiPhy->GetOperatingChannel(), ppduDuration, - m_wifiPhy->GetPhyBand(), ObtainNextUid(txVector)); } diff --git a/src/wifi/model/ht/ht-ppdu.cc b/src/wifi/model/ht/ht-ppdu.cc index 4ff6d07c0..19144dea1 100644 --- a/src/wifi/model/ht/ht-ppdu.cc +++ b/src/wifi/model/ht/ht-ppdu.cc @@ -24,6 +24,7 @@ #include "ht-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-psdu.h" #include "ns3/wifi-utils.h" @@ -35,18 +36,16 @@ NS_LOG_COMPONENT_DEFINE("HtPpdu"); HtPpdu::HtPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid) : OfdmPpdu(psdu, txVector, - txCenterFreq, - band, + channel, uid, false) // don't instantiate LSigHeader of OfdmPpdu { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << ppduDuration << band << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << ppduDuration << uid); SetPhyHeaders(txVector, ppduDuration, psdu->GetSize()); } @@ -74,7 +73,8 @@ void HtPpdu::SetLSigHeader(LSigHeader& lSig, Time ppduDuration) const { uint8_t sigExtension = 0; - if (m_band == WIFI_PHY_BAND_2_4GHZ) + NS_ASSERT(m_operatingChannel.IsSet()); + if (m_operatingChannel.GetPhyBand() == WIFI_PHY_BAND_2_4GHZ) { sigExtension = 6; } @@ -158,7 +158,9 @@ HtPpdu::GetTxDuration() const htLength = m_htSig.GetHtLength(); #endif - ppduDuration = WifiPhy::CalculateTxDuration(htLength, txVector, m_band); + NS_ASSERT(m_operatingChannel.IsSet()); + ppduDuration = + WifiPhy::CalculateTxDuration(htLength, txVector, m_operatingChannel.GetPhyBand()); return ppduDuration; } diff --git a/src/wifi/model/ht/ht-ppdu.h b/src/wifi/model/ht/ht-ppdu.h index 65dc77f0f..a9e20ee19 100644 --- a/src/wifi/model/ht/ht-ppdu.h +++ b/src/wifi/model/ht/ht-ppdu.h @@ -139,16 +139,14 @@ class HtPpdu : public OfdmPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU * \param uid the unique ID of this PPDU */ HtPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid); Time GetTxDuration() const override; diff --git a/src/wifi/model/interference-helper.cc b/src/wifi/model/interference-helper.cc index 4bafa918d..9ba49d5d2 100644 --- a/src/wifi/model/interference-helper.cc +++ b/src/wifi/model/interference-helper.cc @@ -28,6 +28,7 @@ #include "ns3/log.h" #include "ns3/packet.h" #include "ns3/simulator.h" +#include "ns3/wifi-phy-operating-channel.h" #include #include @@ -232,8 +233,9 @@ InterferenceHelper::AddForeignSignal(Time duration, RxPowerWattPerChannelBand& r WifiMacHeader hdr; hdr.SetType(WIFI_MAC_QOSDATA); hdr.SetQosTid(0); - Ptr fakePpdu = - Create(Create(Create(0), hdr), WifiTxVector(), 0); + Ptr fakePpdu = Create(Create(Create(0), hdr), + WifiTxVector(), + WifiPhyOperatingChannel()); Add(fakePpdu, WifiTxVector(), duration, rxPowerW); } diff --git a/src/wifi/model/non-ht/dsss-phy.cc b/src/wifi/model/non-ht/dsss-phy.cc index cd6dd53c2..61ee66a52 100644 --- a/src/wifi/model/non-ht/dsss-phy.cc +++ b/src/wifi/model/non-ht/dsss-phy.cc @@ -200,8 +200,7 @@ DsssPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration); return Create(psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), + m_wifiPhy->GetOperatingChannel(), ppduDuration, ObtainNextUid(txVector)); } diff --git a/src/wifi/model/non-ht/dsss-ppdu.cc b/src/wifi/model/non-ht/dsss-ppdu.cc index 1d7c97c7b..80b29262a 100644 --- a/src/wifi/model/non-ht/dsss-ppdu.cc +++ b/src/wifi/model/non-ht/dsss-ppdu.cc @@ -24,6 +24,7 @@ #include "dsss-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-psdu.h" @@ -34,12 +35,12 @@ NS_LOG_COMPONENT_DEFINE("DsssPpdu"); DsssPpdu::DsssPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, uint64_t uid) - : WifiPpdu(psdu, txVector, txCenterFreq, uid) + : WifiPpdu(psdu, txVector, channel, uid) { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << ppduDuration << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << ppduDuration << uid); SetPhyHeaders(txVector, ppduDuration); } diff --git a/src/wifi/model/non-ht/dsss-ppdu.h b/src/wifi/model/non-ht/dsss-ppdu.h index 75e587cde..222619514 100644 --- a/src/wifi/model/non-ht/dsss-ppdu.h +++ b/src/wifi/model/non-ht/dsss-ppdu.h @@ -101,13 +101,13 @@ class DsssPpdu : public WifiPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU * \param uid the unique ID of this PPDU */ DsssPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, uint64_t uid); diff --git a/src/wifi/model/non-ht/erp-ofdm-phy.cc b/src/wifi/model/non-ht/erp-ofdm-phy.cc index c7da35fcf..fe05aa978 100644 --- a/src/wifi/model/non-ht/erp-ofdm-phy.cc +++ b/src/wifi/model/non-ht/erp-ofdm-phy.cc @@ -116,9 +116,7 @@ ErpOfdmPhy::BuildPpdu(const WifiConstPsduMap& psdus, return Create( psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), - m_wifiPhy->GetPhyBand(), + m_wifiPhy->GetOperatingChannel(), m_wifiPhy->GetLatestPhyEntity()->ObtainNextUid( txVector)); // use latest PHY entity to handle MU-RTS sent with non-HT rate } diff --git a/src/wifi/model/non-ht/erp-ofdm-ppdu.cc b/src/wifi/model/non-ht/erp-ofdm-ppdu.cc index f7f002ace..157d6b1cb 100644 --- a/src/wifi/model/non-ht/erp-ofdm-ppdu.cc +++ b/src/wifi/model/non-ht/erp-ofdm-ppdu.cc @@ -23,6 +23,7 @@ #include "erp-ofdm-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-psdu.h" namespace ns3 @@ -32,12 +33,11 @@ NS_LOG_COMPONENT_DEFINE("ErpOfdmPpdu"); ErpOfdmPpdu::ErpOfdmPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, - WifiPhyBand band, + const WifiPhyOperatingChannel& channel, uint64_t uid) - : OfdmPpdu(psdu, txVector, txCenterFreq, band, uid, true) // add LSigHeader of OfdmPpdu + : OfdmPpdu(psdu, txVector, channel, uid, true) // add LSigHeader of OfdmPpdu { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << band << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << uid); } void diff --git a/src/wifi/model/non-ht/erp-ofdm-ppdu.h b/src/wifi/model/non-ht/erp-ofdm-ppdu.h index 8f54c224b..2cc7a5334 100644 --- a/src/wifi/model/non-ht/erp-ofdm-ppdu.h +++ b/src/wifi/model/non-ht/erp-ofdm-ppdu.h @@ -49,14 +49,12 @@ class ErpOfdmPpdu : public OfdmPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param uid the unique ID of this PPDU */ ErpOfdmPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, - WifiPhyBand band, + const WifiPhyOperatingChannel& channel, uint64_t uid); Ptr Copy() const override; diff --git a/src/wifi/model/non-ht/ofdm-phy.cc b/src/wifi/model/non-ht/ofdm-phy.cc index ba49d7da2..cbe33bf9a 100644 --- a/src/wifi/model/non-ht/ofdm-phy.cc +++ b/src/wifi/model/non-ht/ofdm-phy.cc @@ -298,9 +298,7 @@ OfdmPhy::BuildPpdu(const WifiConstPsduMap& psdus, return Create( psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), - m_wifiPhy->GetPhyBand(), + m_wifiPhy->GetOperatingChannel(), m_wifiPhy->GetLatestPhyEntity()->ObtainNextUid( txVector)); // use latest PHY entity to handle MU-RTS sent with non-HT rate } diff --git a/src/wifi/model/non-ht/ofdm-ppdu.cc b/src/wifi/model/non-ht/ofdm-ppdu.cc index 3d3949795..a7833f034 100644 --- a/src/wifi/model/non-ht/ofdm-ppdu.cc +++ b/src/wifi/model/non-ht/ofdm-ppdu.cc @@ -24,6 +24,7 @@ #include "ofdm-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-psdu.h" @@ -34,15 +35,13 @@ NS_LOG_COMPONENT_DEFINE("OfdmPpdu"); OfdmPpdu::OfdmPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, - WifiPhyBand band, + const WifiPhyOperatingChannel& channel, uint64_t uid, bool instantiateLSig /* = true */) - : WifiPpdu(psdu, txVector, txCenterFreq, uid), - m_band(band), + : WifiPpdu(psdu, txVector, channel, uid), m_channelWidth(txVector.IsNonHtDuplicate() ? 20 : txVector.GetChannelWidth()) { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << band << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << uid); if (instantiateLSig) { SetPhyHeaders(txVector, psdu->GetSize()); @@ -112,7 +111,8 @@ OfdmPpdu::GetTxDuration() const #else length = m_lSig.GetLength(); #endif - return WifiPhy::CalculateTxDuration(length, txVector, m_band); + NS_ASSERT(m_operatingChannel.IsSet()); + return WifiPhy::CalculateTxDuration(length, txVector, m_operatingChannel.GetPhyBand()); } Ptr diff --git a/src/wifi/model/non-ht/ofdm-ppdu.h b/src/wifi/model/non-ht/ofdm-ppdu.h index 96c4d6b88..4cf5c789c 100644 --- a/src/wifi/model/non-ht/ofdm-ppdu.h +++ b/src/wifi/model/non-ht/ofdm-ppdu.h @@ -105,16 +105,14 @@ class OfdmPpdu : public WifiPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param uid the unique ID of this PPDU * \param instantiateLSig flag used to instantiate LSigHeader (set LSigHeader's * rate and length), should be disabled by child classes */ OfdmPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, - WifiPhyBand band, + const WifiPhyOperatingChannel& channel, uint64_t uid, bool instantiateLSig = true); @@ -122,7 +120,6 @@ class OfdmPpdu : public WifiPpdu Ptr Copy() const override; protected: - WifiPhyBand m_band; //!< the WifiPhyBand used to transmit that PPDU #ifndef NS3_BUILD_PROFILE_DEBUG LSigHeader m_lSig; //!< the L-SIG PHY header #endif diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index d41f64c1b..b4ef7206e 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -246,8 +246,7 @@ PhyEntity::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector "version in the amendment-specific subclasses instead!"); return Create(psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth())); // should be overloaded + m_wifiPhy->GetOperatingChannel()); // should be overloaded } Time diff --git a/src/wifi/model/vht/vht-phy.cc b/src/wifi/model/vht/vht-phy.cc index 068d130d5..4edba093b 100644 --- a/src/wifi/model/vht/vht-phy.cc +++ b/src/wifi/model/vht/vht-phy.cc @@ -250,10 +250,8 @@ VhtPhy::BuildPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, T NS_LOG_FUNCTION(this << psdus << txVector << ppduDuration); return Create(psdus.begin()->second, txVector, - m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency( - txVector.GetChannelWidth()), + m_wifiPhy->GetOperatingChannel(), ppduDuration, - m_wifiPhy->GetPhyBand(), ObtainNextUid(txVector)); } diff --git a/src/wifi/model/vht/vht-ppdu.cc b/src/wifi/model/vht/vht-ppdu.cc index 13a4d2477..cac529461 100644 --- a/src/wifi/model/vht/vht-ppdu.cc +++ b/src/wifi/model/vht/vht-ppdu.cc @@ -24,6 +24,7 @@ #include "vht-phy.h" #include "ns3/log.h" +#include "ns3/wifi-phy-operating-channel.h" #include "ns3/wifi-phy.h" #include "ns3/wifi-psdu.h" @@ -34,18 +35,16 @@ NS_LOG_COMPONENT_DEFINE("VhtPpdu"); VhtPpdu::VhtPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid) : OfdmPpdu(psdu, txVector, - txCenterFreq, - band, + channel, uid, false) // don't instantiate LSigHeader of OfdmPpdu { - NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << ppduDuration << band << uid); + NS_LOG_FUNCTION(this << psdu << txVector << channel << ppduDuration << uid); SetPhyHeaders(txVector, ppduDuration); } diff --git a/src/wifi/model/vht/vht-ppdu.h b/src/wifi/model/vht/vht-ppdu.h index b1735dba2..72df7544f 100644 --- a/src/wifi/model/vht/vht-ppdu.h +++ b/src/wifi/model/vht/vht-ppdu.h @@ -23,6 +23,7 @@ #define VHT_PPDU_H #include "ns3/ofdm-ppdu.h" +#include "ns3/wifi-phy-operating-channel.h" /** * \file @@ -153,16 +154,14 @@ class VhtPpdu : public OfdmPpdu * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param ppduDuration the transmission duration of this PPDU - * \param band the WifiPhyBand used for the transmission of this PPDU * \param uid the unique ID of this PPDU */ VhtPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, Time ppduDuration, - WifiPhyBand band, uint64_t uid); Time GetTxDuration() const override; diff --git a/src/wifi/model/wifi-ppdu.cc b/src/wifi/model/wifi-ppdu.cc index e5b4d5992..c9aee663a 100644 --- a/src/wifi/model/wifi-ppdu.cc +++ b/src/wifi/model/wifi-ppdu.cc @@ -23,6 +23,7 @@ #include "ns3/log.h" #include "ns3/packet.h" +#include "ns3/wifi-phy-operating-channel.h" namespace ns3 { @@ -31,33 +32,39 @@ NS_LOG_COMPONENT_DEFINE("WifiPpdu"); WifiPpdu::WifiPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, uint64_t uid /* = UINT64_MAX */) : m_preamble(txVector.GetPreambleType()), m_modulation(txVector.IsValid() ? txVector.GetModulationClass() : WIFI_MOD_CLASS_UNKNOWN), - m_txCenterFreq(txCenterFreq), + m_txCenterFreq(channel.IsSet() + ? channel.GetPrimaryChannelCenterFrequency(txVector.GetChannelWidth()) + : 0), m_uid(uid), m_txVector(txVector), + m_operatingChannel(channel), #ifdef NS3_BUILD_PROFILE_DEBUG m_phyHeaders(Create()), #endif m_truncatedTx(false), m_txPowerLevel(txVector.GetTxPowerLevel()) { - NS_LOG_FUNCTION(this << *psdu << txVector << txCenterFreq << uid); + NS_LOG_FUNCTION(this << *psdu << txVector << channel << uid); m_psdus.insert(std::make_pair(SU_STA_ID, psdu)); } WifiPpdu::WifiPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, uint64_t uid) : m_preamble(txVector.GetPreambleType()), m_modulation(txVector.IsValid() ? txVector.GetMode(psdus.begin()->first).GetModulationClass() : WIFI_MOD_CLASS_UNKNOWN), - m_txCenterFreq(txCenterFreq), + m_txCenterFreq(channel.IsSet() + ? channel.GetPrimaryChannelCenterFrequency(txVector.GetChannelWidth()) + : 0), m_uid(uid), m_txVector(txVector), + m_operatingChannel(channel), #ifdef NS3_BUILD_PROFILE_DEBUG m_phyHeaders(Create()), #endif @@ -65,7 +72,7 @@ WifiPpdu::WifiPpdu(const WifiConstPsduMap& psdus, m_txPowerLevel(txVector.GetTxPowerLevel()), m_txAntennas(txVector.GetNTx()) { - NS_LOG_FUNCTION(this << psdus << txVector << txCenterFreq << uid); + NS_LOG_FUNCTION(this << psdus << txVector << channel << uid); m_psdus = psdus; } diff --git a/src/wifi/model/wifi-ppdu.h b/src/wifi/model/wifi-ppdu.h index 28716116a..3f5d7c2f6 100644 --- a/src/wifi/model/wifi-ppdu.h +++ b/src/wifi/model/wifi-ppdu.h @@ -40,6 +40,7 @@ namespace ns3 class Packet; class WifiPsdu; +class WifiPhyOperatingChannel; /** * Map of const PSDUs indexed by STA-ID @@ -60,24 +61,24 @@ class WifiPpdu : public SimpleRefCount * * \param psdu the PHY payload (PSDU) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param uid the unique ID of this PPDU */ WifiPpdu(Ptr psdu, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, uint64_t uid = UINT64_MAX); /** * Create a PPDU storing a map of PSDUs. * * \param psdus the PHY payloads (PSDUs) * \param txVector the TXVECTOR that was used for this PPDU - * \param txCenterFreq the center frequency (MHz) that was used for this PPDU + * \param channel the operating channel of the PHY used to transmit this PPDU * \param uid the unique ID of this PPDU */ WifiPpdu(const WifiConstPsduMap& psdus, const WifiTxVector& txVector, - uint16_t txCenterFreq, + const WifiPhyOperatingChannel& channel, uint64_t uid); /** * Destructor for WifiPpdu. @@ -206,6 +207,7 @@ class WifiPpdu : public SimpleRefCount mutable std::optional m_txVector; //!< the TXVECTOR at TX PHY or the reconstructed TXVECTOR at RX PHY (or //!< std::nullopt if TXVECTOR has not been reconstructed yet) + const WifiPhyOperatingChannel& m_operatingChannel; //!< the operating channel of the PHY #ifdef NS3_BUILD_PROFILE_DEBUG Ptr m_phyHeaders; //!< the PHY headers contained in this PPDU diff --git a/src/wifi/test/spectrum-wifi-phy-test.cc b/src/wifi/test/spectrum-wifi-phy-test.cc index 1d0af757f..613fd6519 100644 --- a/src/wifi/test/spectrum-wifi-phy-test.cc +++ b/src/wifi/test/spectrum-wifi-phy-test.cc @@ -38,7 +38,6 @@ using namespace ns3; NS_LOG_COMPONENT_DEFINE("SpectrumWifiPhyBasicTest"); static const uint8_t CHANNEL_NUMBER = 36; -static const uint32_t FREQUENCY = 5180; // MHz static const uint16_t CHANNEL_WIDTH = 20; // MHz static const uint16_t GUARD_WIDTH = CHANNEL_WIDTH; // MHz (expanded to channel width to model spectrum mask) @@ -75,9 +74,11 @@ class SpectrumWifiPhyBasicTest : public TestCase /** * Make signal function * \param txPowerWatts the transmit power in watts + * \param channel the operating channel of the PHY used for the transmission * \returns Ptr */ - Ptr MakeSignal(double txPowerWatts); + Ptr MakeSignal(double txPowerWatts, + const WifiPhyOperatingChannel& channel); /** * Send signal function * \param txPowerWatts the transmit power in watts @@ -121,10 +122,17 @@ SpectrumWifiPhyBasicTest::SpectrumWifiPhyBasicTest(std::string name) // Make a Wi-Fi signal to inject directly to the StartRx() method Ptr -SpectrumWifiPhyBasicTest::MakeSignal(double txPowerWatts) +SpectrumWifiPhyBasicTest::MakeSignal(double txPowerWatts, const WifiPhyOperatingChannel& channel) { - WifiTxVector txVector = - WifiTxVector(OfdmPhy::GetOfdmRate6Mbps(), 0, WIFI_PREAMBLE_LONG, 800, 1, 1, 0, 20, false); + WifiTxVector txVector = WifiTxVector(OfdmPhy::GetOfdmRate6Mbps(), + 0, + WIFI_PREAMBLE_LONG, + 800, + 1, + 1, + 0, + CHANNEL_WIDTH, + false); Ptr pkt = Create(1000); WifiMacHeader hdr; @@ -135,13 +143,13 @@ SpectrumWifiPhyBasicTest::MakeSignal(double txPowerWatts) Ptr psdu = Create(pkt, hdr); Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); - Ptr ppdu = Create(psdu, txVector, FREQUENCY, WIFI_PHY_BAND_5GHZ, m_uid++); + Ptr ppdu = Create(psdu, txVector, channel, m_uid++); - Ptr txPowerSpectrum = - WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(FREQUENCY, - CHANNEL_WIDTH, - txPowerWatts, - GUARD_WIDTH); + Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity( + channel.GetPrimaryChannelCenterFrequency(CHANNEL_WIDTH), + CHANNEL_WIDTH, + txPowerWatts, + GUARD_WIDTH); Ptr txParams = Create(); txParams->psd = txPowerSpectrum; txParams->txPhy = nullptr; @@ -156,7 +164,7 @@ SpectrumWifiPhyBasicTest::MakeSignal(double txPowerWatts) void SpectrumWifiPhyBasicTest::SendSignal(double txPowerWatts) { - m_phy->StartRx(MakeSignal(txPowerWatts)); + m_phy->StartRx(MakeSignal(txPowerWatts, m_phy->GetOperatingChannel())); } void diff --git a/src/wifi/test/wifi-phy-cca-test.cc b/src/wifi/test/wifi-phy-cca-test.cc index 652cfe3d0..2ab7b0dbe 100644 --- a/src/wifi/test/wifi-phy-cca-test.cc +++ b/src/wifi/test/wifi-phy-cca-test.cc @@ -94,27 +94,31 @@ class WifiPhyCcaThresholdsTest : public TestCase Ptr CreateDummyPsdu(); /** * Create a non-HT PPDU + * \param channel the operating channel of the PHY used for the transmission * \return a non-HT PPDU */ - Ptr CreateDummyNonHtPpdu(); + Ptr CreateDummyNonHtPpdu(const WifiPhyOperatingChannel& channel); /** * Create a HT PPDU * \param bandwidth the bandwidth used for the transmission the PPDU in MHz + * \param channel the operating channel of the PHY used for the transmission * \return a HT PPDU */ - Ptr CreateDummyHtPpdu(uint16_t bandwidth); + Ptr CreateDummyHtPpdu(uint16_t bandwidth, const WifiPhyOperatingChannel& channel); /** * Create a VHT PPDU * \param bandwidth the bandwidth used for the transmission the PPDU in MHz + * \param channel the operating channel of the PHY used for the transmission * \return a VHT PPDU */ - Ptr CreateDummyVhtPpdu(uint16_t bandwidth); + Ptr CreateDummyVhtPpdu(uint16_t bandwidth, const WifiPhyOperatingChannel& channel); /** * Create a HE PPDU * \param bandwidth the bandwidth used for the transmission the PPDU in MHz + * \param channel the operating channel of the PHY used for the transmission * \return a HE PPDU */ - Ptr CreateDummyHePpdu(uint16_t bandwidth); + Ptr CreateDummyHePpdu(uint16_t bandwidth, const WifiPhyOperatingChannel& channel); /** * Function to verify the CCA threshold that is being reported by a given PHY entity upon @@ -167,54 +171,42 @@ WifiPhyCcaThresholdsTest::CreateDummyPsdu() } Ptr -WifiPhyCcaThresholdsTest::CreateDummyNonHtPpdu() +WifiPhyCcaThresholdsTest::CreateDummyNonHtPpdu(const WifiPhyOperatingChannel& channel) { WifiTxVector txVector = WifiTxVector(OfdmPhy::GetOfdmRate6Mbps(), 0, WIFI_PREAMBLE_LONG, 800, 1, 1, 0, 20, false); Ptr psdu = CreateDummyPsdu(); - return Create(psdu, txVector, P20_CENTER_FREQUENCY, WIFI_PHY_BAND_5GHZ, 0); + return Create(psdu, txVector, channel, 0); } Ptr -WifiPhyCcaThresholdsTest::CreateDummyHtPpdu(uint16_t bandwidth) +WifiPhyCcaThresholdsTest::CreateDummyHtPpdu(uint16_t bandwidth, + const WifiPhyOperatingChannel& channel) { WifiTxVector txVector = WifiTxVector(HtPhy::GetHtMcs0(), 0, WIFI_PREAMBLE_HT_MF, 800, 1, 1, 0, bandwidth, false); Ptr psdu = CreateDummyPsdu(); - return Create(psdu, - txVector, - P20_CENTER_FREQUENCY, - MicroSeconds(100), - WIFI_PHY_BAND_5GHZ, - 0); + return Create(psdu, txVector, channel, MicroSeconds(100), 0); } Ptr -WifiPhyCcaThresholdsTest::CreateDummyVhtPpdu(uint16_t bandwidth) +WifiPhyCcaThresholdsTest::CreateDummyVhtPpdu(uint16_t bandwidth, + const WifiPhyOperatingChannel& channel) { WifiTxVector txVector = WifiTxVector(VhtPhy::GetVhtMcs0(), 0, WIFI_PREAMBLE_VHT_SU, 800, 1, 1, 0, bandwidth, false); Ptr psdu = CreateDummyPsdu(); - return Create(psdu, - txVector, - P20_CENTER_FREQUENCY, - MicroSeconds(100), - WIFI_PHY_BAND_5GHZ, - 0); + return Create(psdu, txVector, channel, MicroSeconds(100), 0); } Ptr -WifiPhyCcaThresholdsTest::CreateDummyHePpdu(uint16_t bandwidth) +WifiPhyCcaThresholdsTest::CreateDummyHePpdu(uint16_t bandwidth, + const WifiPhyOperatingChannel& channel) { WifiTxVector txVector = WifiTxVector(HePhy::GetHeMcs0(), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidth, false); Ptr psdu = CreateDummyPsdu(); - return Create(psdu, - txVector, - P20_CENTER_FREQUENCY, - MicroSeconds(100), - WIFI_PHY_BAND_5GHZ, - 0); + return Create(psdu, txVector, channel, MicroSeconds(100), 0); } void @@ -252,13 +244,9 @@ WifiPhyCcaThresholdsTest::DoSetup() m_phy->SetDevice(m_device); m_device->SetPhy(m_phy); - auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0, - P20_CENTER_FREQUENCY, - 20, - WIFI_STANDARD_80211ax, - WIFI_PHY_BAND_5GHZ)); - m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{channelNum, 20, WIFI_PHY_BAND_5GHZ, 0}); - m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{channelNum, 20, WIFI_PHY_BAND_5GHZ, 0}); + auto channelNum = std::get<0>( + *WifiPhyOperatingChannel::FindFirst(0, 0, 160, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ)); + m_phy->SetOperatingChannel(WifiPhy::ChannelTuple{channelNum, 160, WIFI_PHY_BAND_5GHZ, 0}); m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); m_obssPdAlgorithm = CreateObject(); @@ -292,7 +280,7 @@ WifiPhyCcaThresholdsTest::RunOne() // OFDM PHY: 20 MHz non-HT PPDU in primary channel (20 MHz) if power above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_OFDM), - CreateDummyNonHtPpdu(), + CreateDummyNonHtPpdu(m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); @@ -315,14 +303,14 @@ WifiPhyCcaThresholdsTest::RunOne() // HT PHY: 20 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HT), - CreateDummyHtPpdu(20), + CreateDummyHtPpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // HT PHY: 40 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HT), - CreateDummyHtPpdu(40), + CreateDummyHtPpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); @@ -357,28 +345,28 @@ WifiPhyCcaThresholdsTest::RunOne() // VHT PHY: 20 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(20), + CreateDummyVhtPpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // VHT PHY: 40 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(40), + CreateDummyVhtPpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // VHT PHY: 80 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(80), + CreateDummyVhtPpdu(80, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // VHT PHY: 160 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA // sensitivity threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(160), + CreateDummyVhtPpdu(160, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); @@ -387,42 +375,42 @@ WifiPhyCcaThresholdsTest::RunOne() // VHT PHY: 20 MHz VHT PPDU in secondary channel (20 MHz) if power above the CCA sensitivity // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(20), + CreateDummyVhtPpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY, std::get<0>(m_secondaryCcaSensitivityThresholds)); // VHT PHY: 20 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(20), + CreateDummyVhtPpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::get<0>(m_secondaryCcaSensitivityThresholds)); // VHT PHY: 40 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(40), + CreateDummyVhtPpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::get<1>(m_secondaryCcaSensitivityThresholds)); // VHT PHY: 20 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(20), + CreateDummyVhtPpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::get<0>(m_secondaryCcaSensitivityThresholds)); // VHT PHY: 40 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(40), + CreateDummyVhtPpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::get<1>(m_secondaryCcaSensitivityThresholds)); // VHT PHY: 80 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity // threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_VHT), - CreateDummyVhtPpdu(80), + CreateDummyVhtPpdu(80, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::get<2>(m_secondaryCcaSensitivityThresholds)); @@ -457,28 +445,28 @@ WifiPhyCcaThresholdsTest::RunOne() // HE PHY: 20 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(20), + CreateDummyHePpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // HE PHY: 40 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(40), + CreateDummyHePpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // HE PHY: 80 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(80), + CreateDummyHePpdu(80, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); // HE PHY: 160 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivity // threshold VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(160), + CreateDummyHePpdu(160, m_phy->GetOperatingChannel()), WIFI_CHANLIST_PRIMARY, m_CcaSensitivityDbm); @@ -488,7 +476,7 @@ WifiPhyCcaThresholdsTest::RunOne() // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz // and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(20), + CreateDummyHePpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); @@ -496,7 +484,7 @@ WifiPhyCcaThresholdsTest::RunOne() // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz // and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(20), + CreateDummyHePpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); @@ -505,7 +493,7 @@ WifiPhyCcaThresholdsTest::RunOne() // and the OBSS-PD level plus 3 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(40), + CreateDummyHePpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY40, std::max(m_obssPdLevel + 3.0, std::get<1>(m_secondaryCcaSensitivityThresholds))); @@ -513,7 +501,7 @@ WifiPhyCcaThresholdsTest::RunOne() // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz // and the OBSS-PD level VerifyCcaThreshold(m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(20), + CreateDummyHePpdu(20, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel, std::get<0>(m_secondaryCcaSensitivityThresholds))); @@ -522,7 +510,7 @@ WifiPhyCcaThresholdsTest::RunOne() // and the OBSS-PD level plus 3 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(40), + CreateDummyHePpdu(40, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel + 3.0, std::get<1>(m_secondaryCcaSensitivityThresholds))); @@ -531,7 +519,7 @@ WifiPhyCcaThresholdsTest::RunOne() // and the OBSS-PD level plus 6 dB VerifyCcaThreshold( m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE), - CreateDummyHePpdu(80), + CreateDummyHePpdu(80, m_phy->GetOperatingChannel()), WIFI_CHANLIST_SECONDARY80, std::max(m_obssPdLevel + 6.0, std::get<2>(m_secondaryCcaSensitivityThresholds))); } diff --git a/src/wifi/test/wifi-phy-ofdma-test.cc b/src/wifi/test/wifi-phy-ofdma-test.cc index 2ea4874cb..11d5aa490 100644 --- a/src/wifi/test/wifi-phy-ofdma-test.cc +++ b/src/wifi/test/wifi-phy-ofdma-test.cc @@ -2433,9 +2433,8 @@ TestMultipleHeTbPreambles::RxHeTbPpdu(uint64_t uid, m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand(), staId); Ptr ppdu = Create(psdus, txVector, - DEFAULT_FREQUENCY, + m_phy->GetOperatingChannel(), ppduDuration, - WIFI_PHY_BAND_5GHZ, uid, HePpdu::PSD_NON_HE_PORTION); diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index d494d9746..b4ff9265d 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -149,7 +149,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket(double rxPowerDbm) Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = - Create(psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++); + Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(FREQUENCY, @@ -823,7 +823,7 @@ TestThresholdPreambleDetectionWithFrameCapture::SendPacket(double rxPowerDbm) Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = - Create(psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++); + Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(FREQUENCY, @@ -1871,7 +1871,7 @@ TestSimpleFrameCaptureModel::SendPacket(double rxPowerDbm, uint32_t packetSize) Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = - Create(psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++); + Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(FREQUENCY, @@ -2136,7 +2136,7 @@ TestPhyHeadersReception::SendPacket(double rxPowerDbm) Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = - Create(psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++); + Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(FREQUENCY, @@ -2860,7 +2860,7 @@ TestAmpduReception::SendAmpduWithThreeMpdus(double rxPowerDbm, uint32_t referenc Time txDuration = m_phy->CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand()); Ptr ppdu = - Create(psdu, txVector, FREQUENCY, txDuration, WIFI_PHY_BAND_5GHZ, m_uid++); + Create(psdu, txVector, m_phy->GetOperatingChannel(), txDuration, m_uid++); Ptr txPowerSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(FREQUENCY, @@ -4317,11 +4317,10 @@ class TestUnsupportedBandwidthReception : public TestCase /** * Function to create a PPDU * - * \param band the PHY band to use * \param centerFreqMhz the center frequency used for the transmission of the PPDU (in MHz) * \param bandwidthMhz the bandwidth used for the transmission of the PPDU (in MHz) */ - void SendPpdu(WifiPhyBand band, uint16_t centerFreqMhz, uint16_t bandwidthMhz); + void SendPpdu(uint16_t centerFreqMhz, uint16_t bandwidthMhz); /** * Function called upon a PSDU received successfully @@ -4374,7 +4373,8 @@ class TestUnsupportedBandwidthReception : public TestCase std::optional