From 8191b6e9634d090eb2b6506e56ea4fe0e89dda38 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 27 Sep 2023 14:43:22 -0700 Subject: [PATCH 001/379] 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 6b7dcd88b..73d262a7b 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.40 to ns-3-dev +-------------------------------- + +### New API + +### Changes to existing API + +### Changes to build system + +### Changed behavior + Changes from ns-3.39 to ns-3.40 ------------------------------- diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5e60a81c3..2eb54bb0d 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.40 ------------ From f2a092cb63f0d3ed71c9d0719573f2be427585d8 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 27 Sep 2023 14:45:20 -0700 Subject: [PATCH 002/379] core: Add deprecated for ns-3.41 --- 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 36a787d6e..cd8c5e64f 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_41 + * Tag for things deprecated in version ns-3.41. + */ +#define NS_DEPRECATED_3_41(msg) NS_DEPRECATED(msg) + /** * \ingroup core * \def NS_DEPRECATED_3_40 From 56dd03f3769910feff5a4de79e6be2fcec8e09cd Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Wed, 27 Sep 2023 14:55:37 -0700 Subject: [PATCH 003/379] doc: Make small update and fix a typo --- doc/manual/source/working-with-git.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/manual/source/working-with-git.rst b/doc/manual/source/working-with-git.rst index 161966094..dc6a5d1d5 100644 --- a/doc/manual/source/working-with-git.rst +++ b/doc/manual/source/working-with-git.rst @@ -368,7 +368,7 @@ We change the VERSION field from '3-dev' to '3.34':: $ cat VERSION 3.34 -We next change the file conf.py in the contributing, tutorial, manual, and models directories +We next change the file conf.py in the contributing, installation, tutorial, manual, and models directories to change the strings 'ns-3-dev' to ns-3.34. When you are done, the 'git diff --stat' command should show: @@ -377,10 +377,11 @@ When you are done, the 'git diff --stat' command should show: VERSION | 2 +- doc/contributing/source/conf.py | 4 ++-- + doc/installation/source/conf.py | 4 ++-- doc/manual/source/conf.py | 4 ++-- doc/models/source/conf.py | 4 ++-- doc/tutorial/source/conf.py | 4 ++-- - 5 files changed, 9 insertions(+), 9 deletions(-) + 6 files changed, 11 insertions(+), 11 deletions(-) Make a commit of these files: @@ -404,6 +405,8 @@ Next, make the following change to RELEASE_NOTES.md and commit it: Commit this change: +:: + $ git commit -m"Update availability in RELEASE_NOTES.md" RELEASE_NOTES.md Finally, add a Git annotated tag: From 59246fb83df3f469131a0d172f1234427a3bec5f Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Mon, 2 Oct 2023 23:21:24 +0100 Subject: [PATCH 004/379] Fix spelling typos --- CHANGES.md | 9 +++- RELEASE_NOTES.md | 2 +- doc/manual/source/utilities.rst | 4 +- examples/wireless/wifi-spatial-reuse.cc | 2 +- src/aodv/model/aodv-packet.h | 2 +- src/core/model/wall-clock-synchronizer.cc | 2 +- src/core/test/int64x64-test-suite.cc | 16 +++---- src/dsr/model/dsr-options.cc | 2 +- .../examples/realtime-fd2fd-onoff.cc | 4 +- src/internet-apps/model/dhcp-header.cc | 22 ++++----- src/internet/doc/tcp.rst | 2 +- src/internet/model/arp-l3-protocol.cc | 2 +- src/lr-wpan/doc/lr-wpan.rst | 10 ++-- src/lte/doc/source/lte-testing.rst | 2 +- src/lte/examples/lena-simple-epc-backhaul.cc | 2 +- src/lte/examples/lena-simple-epc.cc | 5 +- src/lte/helper/emu-epc-helper.cc | 7 +-- src/lte/helper/emu-epc-helper.h | 7 +-- src/lte/helper/epc-helper.cc | 7 +-- src/lte/helper/epc-helper.h | 7 +-- src/lte/helper/point-to-point-epc-helper.cc | 9 ++-- src/lte/helper/point-to-point-epc-helper.h | 9 ++-- .../helper/radio-bearer-stats-connector.cc | 5 +- src/lte/helper/radio-bearer-stats-connector.h | 5 +- .../model/a2-a4-rsrq-handover-algorithm.cc | 8 ++-- src/lte/model/a2-a4-rsrq-handover-algorithm.h | 8 ++-- src/lte/model/epc-enb-application.h | 5 +- src/lte/model/fdbet-ff-mac-scheduler.cc | 24 +++++----- src/lte/model/fdbet-ff-mac-scheduler.h | 8 ++-- src/lte/model/lte-anr.cc | 8 ++-- src/lte/model/lte-anr.h | 8 ++-- src/lte/model/lte-enb-rrc.cc | 16 ++++--- src/lte/model/lte-enb-rrc.h | 13 ++--- src/lte/model/lte-radio-bearer-tag.h | 2 +- src/lte/model/lte-rlc-am-header.h | 2 +- src/lte/model/lte-ue-rrc.h | 2 +- src/lte/model/pf-ff-mac-scheduler.cc | 24 +++++----- src/lte/model/pf-ff-mac-scheduler.h | 8 ++-- .../simple-ue-component-carrier-manager.cc | 2 +- src/lte/model/tdbet-ff-mac-scheduler.cc | 24 +++++----- src/lte/model/tdbet-ff-mac-scheduler.h | 8 ++-- src/lte/test/epc-test-run-time.pl | 2 +- src/lte/test/lte-ffr-simple.cc | 4 +- src/lte/test/lte-ffr-simple.h | 4 +- src/lte/test/lte-simple-helper.cc | 3 +- src/lte/test/lte-simple-helper.h | 3 +- src/lte/test/lte-test-entities.cc | 34 +++++++------- src/lte/test/lte-test-frequency-reuse.cc | 36 +++++++------- src/lte/test/lte-test-interference-fr.cc | 6 +-- src/lte/test/lte-test-interference-fr.h | 6 +-- src/lte/test/lte-test-rr-ff-mac-scheduler.cc | 4 +- src/lte/test/lte-test-run-time.pl | 2 +- .../test/lte-test-spectrum-value-helper.cc | 2 +- src/lte/test/lte-test-ue-phy.h | 3 +- src/lte/test/lte-test-uplink-power-control.cc | 24 +++++----- src/lte/test/test-epc-tft-classifier.cc | 5 +- src/lte/test/test-lte-x2-handover-measures.cc | 5 +- src/mesh/model/mesh-point-device.cc | 6 +-- .../reference-point-group-mobility-example.cc | 2 +- src/mobility/helper/ns2-mobility-helper.cc | 2 +- src/network/utils/queue-size.cc | 36 +++++++------- src/network/utils/queue-size.h | 36 +++++++------- src/propagation/doc/propagation.rst | 2 +- .../model/channel-condition-model.cc | 6 +-- src/spectrum/test/two-ray-splm-test-suite.cc | 2 +- src/traffic-control/doc/fq-cobalt.rst | 2 +- .../examples/codel-vs-pfifo-asymmetric.cc | 2 +- src/traffic-control/model/codel-queue-disc.cc | 5 +- src/traffic-control/model/codel-queue-disc.h | 5 +- src/uan/model/uan-mac-rc.h | 2 +- src/wifi/doc/source/wifi-design.rst | 2 +- src/wifi/examples/reference/bianchi11ax.py | 20 ++++---- src/wimax/model/bs-net-device.h | 2 +- src/wimax/model/wimax-net-device.h | 18 +++---- utils/bench-scheduler.cc | 4 +- utils/codespell-ignored-lines | 43 +++++++++++++++++ utils/codespell-ignored-words | 47 ++----------------- utils/tests/README.md | 2 +- 78 files changed, 365 insertions(+), 338 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 73d262a7b..fddd2c207 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,11 @@ Changes from ns-3.40 to ns-3-dev ### Changes to existing API +* The spelling of the following files, classes, functions, constants, defines and enumerated values was corrected; this will affect existing users who were using them with the misspelling. + * (lte) Struct member `fdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `fdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + * (lte) Struct member `tdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `tdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + * (lte) Struct member `pfsFlowPerf_t::lastTtiBytesTrasmitted` in file `pf-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + ### Changes to build system ### Changed behavior @@ -59,7 +64,7 @@ Changes from ns-3.38 to ns-3.39 ### 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`. +* (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 realignment 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. @@ -500,7 +505,7 @@ Changes from ns-3.30 to ns-3.31 * (as reported above) previously the `Config::Connect` and `Config::Set` families of functions would fail silently if the attribute or trace source didn't exist on the path given (typically due to spelling errors). Now those functions will throw a fatal error. If you need the old behavior use the new `...FailSafe ()` variants. * Attempting to deserialize an enum name which wasn't registered with `MakeEnumChecker` now causes a fatal error, rather failing silently. (This can be triggered by setting an enum Attribute from a StringValue.) * As a result of the above API changes in `MobilityBuildingInfo` and `BuildingsHelper` classes, a building aware pathloss models, e.g., `HybridBuildingsPropagationLossModel` is now able to accurately compute the pathloss for a node moving in and out of buildings in a simulation. See [issue 80](https://gitlab.com/nsnam/ns-3-dev/issues/80) for discussion. -* The implementation of the **Wi-Fi channel access** functions has been improved to make them more conformant to the IEEE 802.11-2016 standard. Concerning the DCF, the backoff procedure is no longer invoked when a packet is queued for transmission and the medium has not been idle for a DIFS, but it is invoked if the medium is busy or does not remain idle for a DIFS after the packet has been queued. Concerning the EDCAF, tranmissions are now correctly aligned at slot boundaries. +* The implementation of the **Wi-Fi channel access** functions has been improved to make them more conformant to the IEEE 802.11-2016 standard. Concerning the DCF, the backoff procedure is no longer invoked when a packet is queued for transmission and the medium has not been idle for a DIFS, but it is invoked if the medium is busy or does not remain idle for a DIFS after the packet has been queued. Concerning the EDCAF, transmissions are now correctly aligned at slot boundaries. * Various wifi physical layer behavior around channel occupancy calculation, phy state calculation, and handling different channel widths has been updated. Changes from ns-3.29 to ns-3.30 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2eb54bb0d..02f488230 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1273,7 +1273,7 @@ This release has been tested on the following platforms: - Bug 2587 - tcp: Avoid overflow in htcp.cc - Bug 2590 - traffic-control: Minor enhancements in red-queue-disc{.h, .cc} - Bug 2591 - wifi: 802.11e Block Ack cannot be enabled on HT/VHT stations -- Bug 2594 - wifi: vht-wifi-network very low throughtput at MCS 6, 160 MHz, SGI +- Bug 2594 - wifi: vht-wifi-network very low throughput at MCS 6, 160 MHz, SGI - Bug 2596 - network: EthernetTrailer::GetFcs() should be const - Bug 2601 - wifi: HT stations should use 40 MHz width if configured 80 or 160z - Bug 2604 - wifi: QosData frames separation with Block Ack enabled diff --git a/doc/manual/source/utilities.rst b/doc/manual/source/utilities.rst index 491e58da1..bc2705131 100644 --- a/doc/manual/source/utilities.rst +++ b/doc/manual/source/utilities.rst @@ -94,10 +94,10 @@ Command-line Arguments Program Options: --all: use all schedulers [false] - --cal: use CalendarSheduler [false] + --cal: use CalendarScheduler [false] --calrev: reverse ordering in the CalendarScheduler [false] --heap: use HeapScheduler [false] - --list: use ListSheduler [false] + --list: use ListScheduler [false] --map: use MapScheduler (default) [true] --pri: use PriorityQueue [false] --debug: enable debugging output [false] diff --git a/examples/wireless/wifi-spatial-reuse.cc b/examples/wireless/wifi-spatial-reuse.cc index efcdcfa17..d373b0ba7 100644 --- a/examples/wireless/wifi-spatial-reuse.cc +++ b/examples/wireless/wifi-spatial-reuse.cc @@ -34,7 +34,7 @@ // // STA1 is continuously transmitting data to AP1, while STA2 is continuously sending data to AP2. // Each STA has configurable traffic loads (inter packet interval and packet size). -// It is also possible to configure TX power per node as well as their CCA-ED tresholds. +// It is also possible to configure TX power per node as well as their CCA-ED thresholds. // OBSS_PD spatial reuse feature can be enabled (default) or disabled, and the OBSS_PD // threshold can be set as well (default: -72 dBm). // A simple Friis path loss model is used and a constant PHY rate is considered. diff --git a/src/aodv/model/aodv-packet.h b/src/aodv/model/aodv-packet.h index 47ad243cf..029012207 100644 --- a/src/aodv/model/aodv-packet.h +++ b/src/aodv/model/aodv-packet.h @@ -485,7 +485,7 @@ class RrepHeader : public Header */ void SetPrefixSize(uint8_t sz); /** - * \brief Set the pefix size + * \brief Set the prefix size * \return the prefix size */ uint8_t GetPrefixSize() const; diff --git a/src/core/model/wall-clock-synchronizer.cc b/src/core/model/wall-clock-synchronizer.cc index 0f1d386f7..f11b84ee2 100644 --- a/src/core/model/wall-clock-synchronizer.cc +++ b/src/core/model/wall-clock-synchronizer.cc @@ -128,7 +128,7 @@ WallClockSynchronizer::DoGetDrift(uint64_t ns) // then subtract the current real time in normalized nanoseconds we just got // from the normalized simulation time in nanoseconds that is passed in as // the parameter ns. We return an integer difference, but in reality all of - // the mechanisms that cause wall-clock to simuator time drift cause events + // the mechanisms that cause wall-clock to simulator time drift cause events // to be late. That means that the wall-clock will be higher than the // simulation time and drift will be positive. I would be astonished to // see a negative drift, but the possibility is admitted for other diff --git a/src/core/test/int64x64-test-suite.cc b/src/core/test/int64x64-test-suite.cc index cf9933bb8..dd691477e 100644 --- a/src/core/test/int64x64-test-suite.cc +++ b/src/core/test/int64x64-test-suite.cc @@ -485,7 +485,7 @@ Int64x64ArithmeticTestCase::DoRun() const int64x64_t zero(0, 0); const int64x64_t one(1, 0); const int64x64_t two(2, 0); - const int64x64_t thre(3, 0); + const int64x64_t three(3, 0); std::cout << std::endl; std::cout << GetParent()->GetName() << " Arithmetic: " << GetName() << std::endl; @@ -497,14 +497,14 @@ Int64x64ArithmeticTestCase::DoRun() Check(3, one - two, -one); Check(4, one - (-one), two); Check(5, (-one) - (-two), one); - Check(6, (-one) - two, -thre); + Check(6, (-one) - two, -three); Check(7, zero + zero, zero); Check(8, zero + one, one); Check(9, one + one, two); - Check(10, one + two, thre); + Check(10, one + two, three); Check(11, one + (-one), zero); - Check(12, (-one) + (-two), -thre); + Check(12, (-one) + (-two), -three); Check(13, (-one) + two, one); Check(14, zero * zero, zero); @@ -514,7 +514,7 @@ Int64x64ArithmeticTestCase::DoRun() Check(18, one * (-one), -one); Check(19, (-one) * (-one), one); - Check(20, (two * thre) / thre, two); + Check(20, (two * three) / three, two); // NOLINTEND(misc-redundant-expression) const int64x64_t frac = int64x64_t(0, 0xc000000000000000ULL); // 0.75 @@ -526,7 +526,7 @@ Int64x64ArithmeticTestCase::DoRun() const int64x64_t zerof = zero + frac; const int64x64_t onef = one + frac; const int64x64_t twof = two + frac; - const int64x64_t thref = thre + frac; + const int64x64_t thref = three + frac; // NOLINTBEGIN(misc-redundant-expression) Check(23, zerof, frac); @@ -559,11 +559,11 @@ Int64x64ArithmeticTestCase::DoRun() // NOLINTEND(misc-redundant-expression) // Multiplication followed by division is exact: - Check(46, (two * thre) / thre, two); + Check(46, (two * three) / three, two); Check(47, (twof * thref) / thref, twof); // Division followed by multiplication loses a bit or two: - Check(48, (two / thre) * thre, two, 2 * tol1); + Check(48, (two / three) * three, two, 2 * tol1); Check(49, (twof / thref) * thref, twof, 3 * tol1); // The example below shows that we really do not lose diff --git a/src/dsr/model/dsr-options.cc b/src/dsr/model/dsr-options.cc index 8dd292c80..fcf7c9770 100644 --- a/src/dsr/model/dsr-options.cc +++ b/src/dsr/model/dsr-options.cc @@ -1759,7 +1759,7 @@ DsrOptionAckReq::Process(Ptr packet, DsrOptionAckReqHeader ackReq; p->RemoveHeader(ackReq); /* - * Get the node with ip address and get the dsr extension and reoute cache objects + * Get the node with ip address and get the dsr extension and route cache objects */ Ptr node = GetNodeWithAddress(ipv4Address); Ptr dsr = node->GetObject(); diff --git a/src/fd-net-device/examples/realtime-fd2fd-onoff.cc b/src/fd-net-device/examples/realtime-fd2fd-onoff.cc index 19f3fa64e..2d35cffaa 100644 --- a/src/fd-net-device/examples/realtime-fd2fd-onoff.cc +++ b/src/fd-net-device/examples/realtime-fd2fd-onoff.cc @@ -28,10 +28,10 @@ // | fd-net-device |--------------| fd-net-device | // +----------------+ +----------------+ // -// This example is aimed at measuring the thoughput of the FdNetDevice +// This example is aimed at measuring the throughput of the FdNetDevice // in a pure simulation. For this purpose two FdNetDevices, attached to // different nodes but in a same simulation, are connected using a socket pair. -// TCP traffic is sent at a saturating data rate. Then the thoughput can +// TCP traffic is sent at a saturating data rate. Then the throughput can // be obtained from the generated .pcap files. // // Steps to run the experiment: diff --git a/src/internet-apps/model/dhcp-header.cc b/src/internet-apps/model/dhcp-header.cc index df9d5a603..c7cac11a8 100644 --- a/src/internet-apps/model/dhcp-header.cc +++ b/src/internet-apps/model/dhcp-header.cc @@ -383,8 +383,8 @@ uint32_t DhcpHeader::Deserialize(Buffer::Iterator start) { uint32_t len; - uint32_t clen = start.GetSize(); - if (clen < 240) + uint32_t cLen = start.GetSize(); + if (cLen < 240) { NS_LOG_WARN("Malformed Packet"); return 0; @@ -416,7 +416,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) bool loop = true; do { - if (len + 1 <= clen) + if (len + 1 <= cLen) { option = i.ReadU8(); len += 1; @@ -429,7 +429,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) switch (option) { case OP_MASK: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); m_mask = i.ReadNtohU32(); @@ -442,7 +442,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_ROUTE: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); ReadFrom(i, m_route); @@ -455,7 +455,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_MSGTYPE: - if (len + 2 < clen) + if (len + 2 < cLen) { i.ReadU8(); m_op = (i.ReadU8() - 1); @@ -468,7 +468,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_SERVID: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); ReadFrom(i, m_dhcps); @@ -481,7 +481,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_ADDREQ: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); ReadFrom(i, m_req); @@ -494,7 +494,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_LEASE: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); m_lease = i.ReadNtohU32(); @@ -507,7 +507,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_RENEW: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); m_renew = i.ReadNtohU32(); @@ -520,7 +520,7 @@ DhcpHeader::Deserialize(Buffer::Iterator start) } break; case OP_REBIND: - if (len + 5 < clen) + if (len + 5 < cLen) { i.ReadU8(); m_rebind = i.ReadNtohU32(); diff --git a/src/internet/doc/tcp.rst b/src/internet/doc/tcp.rst index bb4a1ca52..5515f816b 100644 --- a/src/internet/doc/tcp.rst +++ b/src/internet/doc/tcp.rst @@ -1596,7 +1596,7 @@ SACK based loss recovery is used when sender and receiver support SACK options. In the case when SACK options are disabled, the NewReno modification handles the recovery. -At the start of recovery phase the congestion window is reduced diffently for +At the start of recovery phase the congestion window is reduced differently for NewReno and SACK based recovery. For NewReno the reduction is done as given below: .. math:: cWnd = ssThresh diff --git a/src/internet/model/arp-l3-protocol.cc b/src/internet/model/arp-l3-protocol.cc index 40de28e9e..e9831d25a 100644 --- a/src/internet/model/arp-l3-protocol.cc +++ b/src/internet/model/arp-l3-protocol.cc @@ -191,7 +191,7 @@ ArpL3Protocol::Receive(Ptr device, // // If we're connected to a real world network, then some of the fields sizes // in an ARP packet can vary in ways not seen in simulations. We need to be - // able to detect ARP packets with headers we don't recongnize and not process + // able to detect ARP packets with headers we don't recognize and not process // them instead of crashing. The ArpHeader will return 0 if it can't deal // with the received header. // diff --git a/src/lr-wpan/doc/lr-wpan.rst b/src/lr-wpan/doc/lr-wpan.rst index 192a15f2d..e56dd7494 100644 --- a/src/lr-wpan/doc/lr-wpan.rst +++ b/src/lr-wpan/doc/lr-wpan.rst @@ -232,10 +232,10 @@ The receiver sensitivity can be changed to different values using ``SetRxSensiti | <--------------------------------------->| Acceptable sensitivity range -The example ``lr-wpan-per-plot.cc` shows that at given Rx sensitiviy, packets are dropped regardless of their theoretical error probability. +The example ``lr-wpan-per-plot.cc` shows that at given Rx sensitivity, packets are dropped regardless of their theoretical error probability. This program outputs a file named ``802.15.4-per-vs-rxSignal.plt``. Loading this file into gnuplot yields a file ``802.15.4-per-vs-rsSignal.eps``, which can -be converted to pdf or other formats. Packet payload size, Tx power and Rx sensitivity can be configurated. +be converted to pdf or other formats. Packet payload size, Tx power and Rx sensitivity can be configured. The point where the blue line crosses with the PER indicates the Rx sensitivity. The default output is shown below. .. _fig-802-15-4-per-sens: @@ -301,7 +301,7 @@ in the upper-layer notification callback, which can contain either the pseudo-ad the long address (64 bit) of the sender. Note also that RFC 4944 or RFC 6282 are the RFCs defining the IPv6 address compression formats -(HC1 and IPHC respectively). It is defintely not a good idea to either mix devices using different +(HC1 and IPHC respectively). It is definitely not a good idea to either mix devices using different pseudo-address format or compression types in the same network. This point is further discussed in the ``sixlowpan`` module documentation. @@ -393,8 +393,8 @@ The program outputs a file named ``802.15.4-psr-distance.plt``. Loading this file into gnuplot yields a file ``802.15.4-psr-distance.eps``, which can be converted to pdf or other formats. The following image shows the output of multiple runs using different Rx sensitivity values. A higher Rx sensitivity (lower dBm) results -in a increased communication distance but also makes the radio suceptible to more interference from -surronding devices. +in a increased communication distance but also makes the radio susceptible to more interference from +surrounding devices. .. _fig-802-15-4-psr-distance: diff --git a/src/lte/doc/source/lte-testing.rst b/src/lte/doc/source/lte-testing.rst index a8b0a635a..08dd6f832 100644 --- a/src/lte/doc/source/lte-testing.rst +++ b/src/lte/doc/source/lte-testing.rst @@ -947,7 +947,7 @@ where :math:`P_s^i` is the probability of receiving with success the HARQ block \mathrm{T_{test-2}} = 0.0 \times 1 + 0.752 \times 2 + 0.248 \times 3 = 2.248 -The expected throughput is calculted by counting the number of transmission slots available during the simulation (e.g., the number of TTIs) and the size of the TB in the simulation, in detail: +The expected throughput is calculated by counting the number of transmission slots available during the simulation (e.g., the number of TTIs) and the size of the TB in the simulation, in detail: .. math:: diff --git a/src/lte/examples/lena-simple-epc-backhaul.cc b/src/lte/examples/lena-simple-epc-backhaul.cc index 2353098aa..58270c3f8 100644 --- a/src/lte/examples/lena-simple-epc-backhaul.cc +++ b/src/lte/examples/lena-simple-epc-backhaul.cc @@ -14,7 +14,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Manuel Requena + * Author: Manuel Requena */ #include "ns3/applications-module.h" diff --git a/src/lte/examples/lena-simple-epc.cc b/src/lte/examples/lena-simple-epc.cc index f2480fd57..4c64d60a0 100644 --- a/src/lte/examples/lena-simple-epc.cc +++ b/src/lte/examples/lena-simple-epc.cc @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Jaume Nin - * Manuel Requena + * Authors: + * Jaume Nin + * Manuel Requena */ #include "ns3/applications-module.h" diff --git a/src/lte/helper/emu-epc-helper.cc b/src/lte/helper/emu-epc-helper.cc index 18c51817d..21e873b35 100644 --- a/src/lte/helper/emu-epc-helper.cc +++ b/src/lte/helper/emu-epc-helper.cc @@ -14,9 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena */ #include "emu-epc-helper.h" diff --git a/src/lte/helper/emu-epc-helper.h b/src/lte/helper/emu-epc-helper.h index 5e2dc4daa..0b97420d3 100644 --- a/src/lte/helper/emu-epc-helper.h +++ b/src/lte/helper/emu-epc-helper.h @@ -14,9 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena */ #ifndef EMU_EPC_HELPER_H diff --git a/src/lte/helper/epc-helper.cc b/src/lte/helper/epc-helper.cc index 7e95db508..4d29cf7da 100644 --- a/src/lte/helper/epc-helper.cc +++ b/src/lte/helper/epc-helper.cc @@ -14,9 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena */ #include "epc-helper.h" diff --git a/src/lte/helper/epc-helper.h b/src/lte/helper/epc-helper.h index 451c81686..245eb6eb0 100644 --- a/src/lte/helper/epc-helper.h +++ b/src/lte/helper/epc-helper.h @@ -14,9 +14,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena */ #ifndef EPC_HELPER_H diff --git a/src/lte/helper/point-to-point-epc-helper.cc b/src/lte/helper/point-to-point-epc-helper.cc index a5ed68ce7..c8efc26bf 100644 --- a/src/lte/helper/point-to-point-epc-helper.cc +++ b/src/lte/helper/point-to-point-epc-helper.cc @@ -14,10 +14,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena - * (most of the code refactored to no-backhaul-epc-helper.cc) + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena + * (most of the code refactored to no-backhaul-epc-helper.cc) */ #include "point-to-point-epc-helper.h" diff --git a/src/lte/helper/point-to-point-epc-helper.h b/src/lte/helper/point-to-point-epc-helper.h index 8c7f041c9..0480cc1c4 100644 --- a/src/lte/helper/point-to-point-epc-helper.h +++ b/src/lte/helper/point-to-point-epc-helper.h @@ -14,10 +14,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo - * Manuel Requena - * (most of the code refactored to no-backhaul-epc-helper.h) + * Authors: + * Jaume Nin + * Nicola Baldo + * Manuel Requena + * (most of the code refactored to no-backhaul-epc-helper.h) */ #ifndef POINT_TO_POINT_EPC_HELPER_H diff --git a/src/lte/helper/radio-bearer-stats-connector.cc b/src/lte/helper/radio-bearer-stats-connector.cc index 42d073c23..e3e371e2d 100644 --- a/src/lte/helper/radio-bearer-stats-connector.cc +++ b/src/lte/helper/radio-bearer-stats-connector.cc @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Manuel Requena + * Authors: + * Nicola Baldo + * Manuel Requena */ #include "radio-bearer-stats-connector.h" diff --git a/src/lte/helper/radio-bearer-stats-connector.h b/src/lte/helper/radio-bearer-stats-connector.h index 95b48bfcc..53aa3754f 100644 --- a/src/lte/helper/radio-bearer-stats-connector.h +++ b/src/lte/helper/radio-bearer-stats-connector.h @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Manuel Requena + * Authors: + * Nicola Baldo + * Manuel Requena */ #ifndef RADIO_BEARER_STATS_CONNECTOR_H diff --git a/src/lte/model/a2-a4-rsrq-handover-algorithm.cc b/src/lte/model/a2-a4-rsrq-handover-algorithm.cc index 46b0012c4..f3a0d2e0f 100644 --- a/src/lte/model/a2-a4-rsrq-handover-algorithm.cc +++ b/src/lte/model/a2-a4-rsrq-handover-algorithm.cc @@ -16,12 +16,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Original work authors (from lte-enb-rrc.cc): - * - Nicola Baldo - * - Marco Miozzo - * - Manuel Requena + * Nicola Baldo + * Marco Miozzo + * Manuel Requena * * Converted to handover algorithm interface by: - * - Budiarto Herman + * Budiarto Herman */ #include "a2-a4-rsrq-handover-algorithm.h" diff --git a/src/lte/model/a2-a4-rsrq-handover-algorithm.h b/src/lte/model/a2-a4-rsrq-handover-algorithm.h index e45885b7c..316c987c2 100644 --- a/src/lte/model/a2-a4-rsrq-handover-algorithm.h +++ b/src/lte/model/a2-a4-rsrq-handover-algorithm.h @@ -16,12 +16,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Original work authors (from lte-enb-rrc.cc): - * - Nicola Baldo - * - Marco Miozzo - * - Manuel Requena + * Nicola Baldo + * Marco Miozzo + * Manuel Requena * * Converted to handover algorithm interface by: - * - Budiarto Herman + * Budiarto Herman */ #ifndef A2_A4_RSRQ_HANDOVER_ALGORITHM_H diff --git a/src/lte/model/epc-enb-application.h b/src/lte/model/epc-enb-application.h index fef63a18b..a534b052a 100644 --- a/src/lte/model/epc-enb-application.h +++ b/src/lte/model/epc-enb-application.h @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Jaume Nin - * Nicola Baldo + * Authors: + * Jaume Nin + * Nicola Baldo */ #ifndef EPC_ENB_APPLICATION_H diff --git a/src/lte/model/fdbet-ff-mac-scheduler.cc b/src/lte/model/fdbet-ff-mac-scheduler.cc index 72b4710d3..749ce0c39 100644 --- a/src/lte/model/fdbet-ff-mac-scheduler.cc +++ b/src/lte/model/fdbet-ff-mac-scheduler.cc @@ -214,13 +214,13 @@ FdBetFfMacScheduler::DoCschedLcConfigReq( fdbetsFlowPerf_t flowStatsDl; flowStatsDl.flowStart = Simulator::Now(); flowStatsDl.totalBytesTransmitted = 0; - flowStatsDl.lastTtiBytesTrasmitted = 0; + flowStatsDl.lastTtiBytesTransmitted = 0; flowStatsDl.lastAveragedThroughput = 1; m_flowStatsDl.insert(std::pair(params.m_rnti, flowStatsDl)); fdbetsFlowPerf_t flowStatsUl; flowStatsUl.flowStart = Simulator::Now(); flowStatsUl.totalBytesTransmitted = 0; - flowStatsUl.lastTtiBytesTrasmitted = 0; + flowStatsUl.lastTtiBytesTransmitted = 0; flowStatsUl.lastAveragedThroughput = 1; m_flowStatsUl.insert(std::pair(params.m_rnti, flowStatsUl)); } @@ -1023,7 +1023,7 @@ FdBetFfMacScheduler::DoSchedDlTriggerReq( // reset TTI stats of users for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } // generate the transmission opportunities by grouping the RBGs of the same RNTI and @@ -1158,8 +1158,8 @@ FdBetFfMacScheduler::DoSchedDlTriggerReq( auto it = m_flowStatsDl.find((*itMap).first); if (it != m_flowStatsDl.end()) { - (*it).second.lastTtiBytesTrasmitted = bytesTxed; - NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted); + (*it).second.lastTtiBytesTransmitted = bytesTxed; + NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTransmitted); } else { @@ -1174,15 +1174,15 @@ FdBetFfMacScheduler::DoSchedDlTriggerReq( NS_LOG_INFO(this << " Update UEs statistics"); for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_schedSapUser->SchedDlConfigInd(ret); @@ -1640,7 +1640,7 @@ FdBetFfMacScheduler::DoSchedUlTriggerReq( auto itStats = m_flowStatsUl.find((*it).first); if (itStats != m_flowStatsUl.end()) { - (*itStats).second.lastTtiBytesTrasmitted = uldci.m_tbSize; + (*itStats).second.lastTtiBytesTransmitted = uldci.m_tbSize; } else { @@ -1665,15 +1665,15 @@ FdBetFfMacScheduler::DoSchedUlTriggerReq( // update UEs stats for (auto itStats = m_flowStatsUl.begin(); itStats != m_flowStatsUl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_allocationMaps.insert( std::pair>(params.m_sfnSf, rbgAllocationMap)); diff --git a/src/lte/model/fdbet-ff-mac-scheduler.h b/src/lte/model/fdbet-ff-mac-scheduler.h index 7e4c02269..aa757a313 100644 --- a/src/lte/model/fdbet-ff-mac-scheduler.h +++ b/src/lte/model/fdbet-ff-mac-scheduler.h @@ -39,10 +39,10 @@ namespace ns3 /// fdbetsFlowPerf_t structure struct fdbetsFlowPerf_t { - Time flowStart; ///< flow start time - unsigned long totalBytesTransmitted; ///< total bytes transmitted - unsigned int lastTtiBytesTrasmitted; ///< last total bytes transmitted - double lastAveragedThroughput; ///< last averaged throughput + Time flowStart; ///< flow start time + unsigned long totalBytesTransmitted; ///< total bytes transmitted + unsigned int lastTtiBytesTransmitted; ///< last total bytes transmitted + double lastAveragedThroughput; ///< last averaged throughput }; /** diff --git a/src/lte/model/lte-anr.cc b/src/lte/model/lte-anr.cc index b74d1adc2..087b3d7c6 100644 --- a/src/lte/model/lte-anr.cc +++ b/src/lte/model/lte-anr.cc @@ -16,12 +16,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Original work authors (from lte-enb-rrc.cc): - * - Nicola Baldo - * - Marco Miozzo - * - Manuel Requena + * Nicola Baldo + * Marco Miozzo + * Manuel Requena * * Converted to ANR interface by: - * - Budiarto Herman + * Budiarto Herman */ #include "lte-anr.h" diff --git a/src/lte/model/lte-anr.h b/src/lte/model/lte-anr.h index b93064784..9a7438f7b 100644 --- a/src/lte/model/lte-anr.h +++ b/src/lte/model/lte-anr.h @@ -16,12 +16,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Original work authors (from lte-enb-rrc.cc): - * - Nicola Baldo - * - Marco Miozzo - * - Manuel Requena + * Nicola Baldo + * Marco Miozzo + * Manuel Requena * * Converted to ANR interface by: - * - Budiarto Herman + * Budiarto Herman */ #ifndef LTE_ANR_H diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index f1e690823..7c632c40e 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -15,12 +15,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Marco Miozzo - * Manuel Requena - * Modified by: Danilo Abrignani (Carrier Aggregation - GSoC 2015), - * Biljana Bojovic (Carrier Aggregation) - * Vignesh Babu (RLF extensions) + * Authors: + * Nicola Baldo + * Marco Miozzo + * Manuel Requena + * Modified by: + * Danilo Abrignani (Carrier Aggregation - GSoC 2015), + * Biljana Bojovic (Carrier Aggregation) + * Vignesh Babu (RLF extensions) */ #include "lte-enb-rrc.h" @@ -140,7 +142,7 @@ NS_OBJECT_ENSURE_REGISTERED(UeManager); UeManager::UeManager() { - NS_FATAL_ERROR("this constructor is not espected to be used"); + NS_FATAL_ERROR("this constructor is not expected to be used"); } UeManager::UeManager(Ptr rrc, uint16_t rnti, State s, uint8_t componentCarrierId) diff --git a/src/lte/model/lte-enb-rrc.h b/src/lte/model/lte-enb-rrc.h index 63b0fafaf..83ce5fb9b 100644 --- a/src/lte/model/lte-enb-rrc.h +++ b/src/lte/model/lte-enb-rrc.h @@ -15,13 +15,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Marco Miozzo - * Manuel Requena + * Authors: + * Nicola Baldo + * Marco Miozzo + * Manuel Requena * Modified by: - * Danilo Abrignani (Carrier Aggregation - GSoC 2015) - * Biljana Bojovic (Carrier Aggregation) - * Vignesh Babu (RLF extensions) + * Danilo Abrignani (Carrier Aggregation - GSoC 2015) + * Biljana Bojovic (Carrier Aggregation) + * Vignesh Babu (RLF extensions) */ #ifndef LTE_ENB_RRC_H diff --git a/src/lte/model/lte-radio-bearer-tag.h b/src/lte/model/lte-radio-bearer-tag.h index ce67a5a73..f345bf17b 100644 --- a/src/lte/model/lte-radio-bearer-tag.h +++ b/src/lte/model/lte-radio-bearer-tag.h @@ -27,7 +27,7 @@ namespace ns3 class Tag; /** - * Tag used to define the RNTI and LC id for each MAC packet trasmitted + * Tag used to define the RNTI and LC id for each MAC packet transmitted */ class LteRadioBearerTag : public Tag diff --git a/src/lte/model/lte-rlc-am-header.h b/src/lte/model/lte-rlc-am-header.h index 4ddc99802..773b50ef7 100644 --- a/src/lte/model/lte-rlc-am-header.h +++ b/src/lte/model/lte-rlc-am-header.h @@ -246,7 +246,7 @@ class LteRlcAmHeader : public Header /** * Get ack sn function * - * \returns sequence numbr + * \returns sequence number */ SequenceNumber10 GetAckSn() const; diff --git a/src/lte/model/lte-ue-rrc.h b/src/lte/model/lte-ue-rrc.h index d89dd9909..b760faa45 100644 --- a/src/lte/model/lte-ue-rrc.h +++ b/src/lte/model/lte-ue-rrc.h @@ -136,7 +136,7 @@ class LteUeRrc : public Object */ static TypeId GetTypeId(); - /// Initiaize SAP + /// Initialize SAP void InitializeSap(); /** diff --git a/src/lte/model/pf-ff-mac-scheduler.cc b/src/lte/model/pf-ff-mac-scheduler.cc index 34fee7b2d..bf3c57e55 100644 --- a/src/lte/model/pf-ff-mac-scheduler.cc +++ b/src/lte/model/pf-ff-mac-scheduler.cc @@ -216,13 +216,13 @@ PfFfMacScheduler::DoCschedLcConfigReq( pfsFlowPerf_t flowStatsDl; flowStatsDl.flowStart = Simulator::Now(); flowStatsDl.totalBytesTransmitted = 0; - flowStatsDl.lastTtiBytesTrasmitted = 0; + flowStatsDl.lastTtiBytesTransmitted = 0; flowStatsDl.lastAveragedThroughput = 1; m_flowStatsDl.insert(std::pair(params.m_rnti, flowStatsDl)); pfsFlowPerf_t flowStatsUl; flowStatsUl.flowStart = Simulator::Now(); flowStatsUl.totalBytesTransmitted = 0; - flowStatsUl.lastTtiBytesTrasmitted = 0; + flowStatsUl.lastTtiBytesTransmitted = 0; flowStatsUl.lastAveragedThroughput = 1; m_flowStatsUl.insert(std::pair(params.m_rnti, flowStatsUl)); } @@ -1040,7 +1040,7 @@ PfFfMacScheduler::DoSchedDlTriggerReq( // reset TTI stats of users for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } // generate the transmission opportunities by grouping the RBGs of the same RNTI and @@ -1224,8 +1224,8 @@ PfFfMacScheduler::DoSchedDlTriggerReq( auto it = m_flowStatsDl.find((*itMap).first); if (it != m_flowStatsDl.end()) { - (*it).second.lastTtiBytesTrasmitted = bytesTxed; - NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted); + (*it).second.lastTtiBytesTransmitted = bytesTxed; + NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTransmitted); } else { @@ -1240,15 +1240,15 @@ PfFfMacScheduler::DoSchedDlTriggerReq( NS_LOG_INFO(this << " Update UEs statistics"); for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_schedSapUser->SchedDlConfigInd(ret); @@ -1735,7 +1735,7 @@ PfFfMacScheduler::DoSchedUlTriggerReq( auto itStats = m_flowStatsUl.find((*it).first); if (itStats != m_flowStatsUl.end()) { - (*itStats).second.lastTtiBytesTrasmitted = uldci.m_tbSize; + (*itStats).second.lastTtiBytesTransmitted = uldci.m_tbSize; } else { @@ -1760,15 +1760,15 @@ PfFfMacScheduler::DoSchedUlTriggerReq( // update UEs stats for (auto itStats = m_flowStatsUl.begin(); itStats != m_flowStatsUl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_allocationMaps.insert( std::pair>(params.m_sfnSf, rbgAllocationMap)); diff --git a/src/lte/model/pf-ff-mac-scheduler.h b/src/lte/model/pf-ff-mac-scheduler.h index 738380abc..2df67e476 100644 --- a/src/lte/model/pf-ff-mac-scheduler.h +++ b/src/lte/model/pf-ff-mac-scheduler.h @@ -38,10 +38,10 @@ namespace ns3 /// pfsFlowPerf_t structure struct pfsFlowPerf_t { - Time flowStart; ///< flow start time - unsigned long totalBytesTransmitted; ///< total bytes transmitted - unsigned int lastTtiBytesTrasmitted; ///< last total bytes transmitted - double lastAveragedThroughput; ///< last averaged throughput + Time flowStart; ///< flow start time + unsigned long totalBytesTransmitted; ///< total bytes transmitted + unsigned int lastTtiBytesTransmitted; ///< last total bytes transmitted + double lastAveragedThroughput; ///< last averaged throughput }; /** diff --git a/src/lte/model/simple-ue-component-carrier-manager.cc b/src/lte/model/simple-ue-component-carrier-manager.cc index 52f3e77b4..c2845764a 100644 --- a/src/lte/model/simple-ue-component-carrier-manager.cc +++ b/src/lte/model/simple-ue-component-carrier-manager.cc @@ -229,7 +229,7 @@ SimpleUeComponentCarrierManager::DoNotifyTxOpportunity( NS_ABORT_MSG_IF(lcidIt == m_lcAttached.end(), "could not find LCID" << (uint16_t)txOpParams.lcid); NS_LOG_DEBUG(this << " lcid = " << (uint32_t)txOpParams.lcid - << " layer= " << (uint16_t)txOpParams.layer << " componentCarierId " + << " layer= " << (uint16_t)txOpParams.layer << " componentCarrierId " << (uint16_t)txOpParams.componentCarrierId << " rnti " << txOpParams.rnti); NS_LOG_DEBUG(this << " MAC is asking component carrier id = " diff --git a/src/lte/model/tdbet-ff-mac-scheduler.cc b/src/lte/model/tdbet-ff-mac-scheduler.cc index 4de5bdf72..617fa8b3e 100644 --- a/src/lte/model/tdbet-ff-mac-scheduler.cc +++ b/src/lte/model/tdbet-ff-mac-scheduler.cc @@ -214,13 +214,13 @@ TdBetFfMacScheduler::DoCschedLcConfigReq( tdbetsFlowPerf_t flowStatsDl; flowStatsDl.flowStart = Simulator::Now(); flowStatsDl.totalBytesTransmitted = 0; - flowStatsDl.lastTtiBytesTrasmitted = 0; + flowStatsDl.lastTtiBytesTransmitted = 0; flowStatsDl.lastAveragedThroughput = 1; m_flowStatsDl.insert(std::pair(params.m_rnti, flowStatsDl)); tdbetsFlowPerf_t flowStatsUl; flowStatsUl.flowStart = Simulator::Now(); flowStatsUl.totalBytesTransmitted = 0; - flowStatsUl.lastTtiBytesTrasmitted = 0; + flowStatsUl.lastTtiBytesTransmitted = 0; flowStatsUl.lastAveragedThroughput = 1; m_flowStatsUl.insert(std::pair(params.m_rnti, flowStatsUl)); } @@ -945,7 +945,7 @@ TdBetFfMacScheduler::DoSchedDlTriggerReq( // reset TTI stats of users for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } // generate the transmission opportunities by grouping the RBGs of the same RNTI and @@ -1080,8 +1080,8 @@ TdBetFfMacScheduler::DoSchedDlTriggerReq( auto it = m_flowStatsDl.find((*itMap).first); if (it != m_flowStatsDl.end()) { - (*it).second.lastTtiBytesTrasmitted = bytesTxed; - NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTrasmitted); + (*it).second.lastTtiBytesTransmitted = bytesTxed; + NS_LOG_INFO(this << " UE total bytes txed " << (*it).second.lastTtiBytesTransmitted); } else { @@ -1096,15 +1096,15 @@ TdBetFfMacScheduler::DoSchedDlTriggerReq( NS_LOG_INFO(this << " Update UEs statistics"); for (auto itStats = m_flowStatsDl.begin(); itStats != m_flowStatsDl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_schedSapUser->SchedDlConfigInd(ret); @@ -1562,7 +1562,7 @@ TdBetFfMacScheduler::DoSchedUlTriggerReq( auto itStats = m_flowStatsUl.find((*it).first); if (itStats != m_flowStatsUl.end()) { - (*itStats).second.lastTtiBytesTrasmitted = uldci.m_tbSize; + (*itStats).second.lastTtiBytesTransmitted = uldci.m_tbSize; } else { @@ -1587,15 +1587,15 @@ TdBetFfMacScheduler::DoSchedUlTriggerReq( // update UEs stats for (auto itStats = m_flowStatsUl.begin(); itStats != m_flowStatsUl.end(); itStats++) { - (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTrasmitted; + (*itStats).second.totalBytesTransmitted += (*itStats).second.lastTtiBytesTransmitted; // update average throughput (see eq. 12.3 of Sec 12.3.1.2 of LTE – The UMTS Long Term // Evolution, Ed Wiley) (*itStats).second.lastAveragedThroughput = ((1.0 - (1.0 / m_timeWindow)) * (*itStats).second.lastAveragedThroughput) + - ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTrasmitted / 0.001)); + ((1.0 / m_timeWindow) * (double)((*itStats).second.lastTtiBytesTransmitted / 0.001)); NS_LOG_INFO(this << " UE total bytes " << (*itStats).second.totalBytesTransmitted); NS_LOG_INFO(this << " UE average throughput " << (*itStats).second.lastAveragedThroughput); - (*itStats).second.lastTtiBytesTrasmitted = 0; + (*itStats).second.lastTtiBytesTransmitted = 0; } m_allocationMaps.insert( std::pair>(params.m_sfnSf, rbgAllocationMap)); diff --git a/src/lte/model/tdbet-ff-mac-scheduler.h b/src/lte/model/tdbet-ff-mac-scheduler.h index a9b056f1e..63fd67f27 100644 --- a/src/lte/model/tdbet-ff-mac-scheduler.h +++ b/src/lte/model/tdbet-ff-mac-scheduler.h @@ -39,10 +39,10 @@ namespace ns3 /// tdbetsFlowPerf_t structure struct tdbetsFlowPerf_t { - Time flowStart; ///< flow start time - unsigned long totalBytesTransmitted; ///< total bytes transmitted - unsigned int lastTtiBytesTrasmitted; ///< last total bytes transmitted - double lastAveragedThroughput; ///< last average throughput + Time flowStart; ///< flow start time + unsigned long totalBytesTransmitted; ///< total bytes transmitted + unsigned int lastTtiBytesTransmitted; ///< last total bytes transmitted + double lastAveragedThroughput; ///< last average throughput }; /** diff --git a/src/lte/test/epc-test-run-time.pl b/src/lte/test/epc-test-run-time.pl index 2a2ca1262..1664f2e6f 100755 --- a/src/lte/test/epc-test-run-time.pl +++ b/src/lte/test/epc-test-run-time.pl @@ -13,7 +13,7 @@ my @nodes = ( 1,2,3,4,5,6,7, 8, 12, 14); my @simTime = (5, 10); -# Configure and complite first the program to avoid counting compilation time as running time +# Configure and compile first the program to avoid counting compilation time as running time my $launch = "CXXFLAGS=\"-O3 -w\" ./ns3 configure -d optimized --enable-static --enable-examples --enable-modules=lte"; my $out, my $err; capture { system($launch ) } \$out, \$err; diff --git a/src/lte/test/lte-ffr-simple.cc b/src/lte/test/lte-ffr-simple.cc index 6a28394e2..a6a00041c 100644 --- a/src/lte/test/lte-ffr-simple.cc +++ b/src/lte/test/lte-ffr-simple.cc @@ -165,11 +165,11 @@ LteFfrSimple::SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfi } void -LteFfrSimple::SetTpc(uint32_t tpc, uint32_t num, bool acculumatedMode) +LteFfrSimple::SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode) { m_tpc = tpc; m_tpcNum = num; - m_accumulatedMode = acculumatedMode; + m_accumulatedMode = accumulatedMode; } std::vector diff --git a/src/lte/test/lte-ffr-simple.h b/src/lte/test/lte-ffr-simple.h index 492e5e40d..aefc2613a 100644 --- a/src/lte/test/lte-ffr-simple.h +++ b/src/lte/test/lte-ffr-simple.h @@ -71,9 +71,9 @@ class LteFfrSimple : public LteFfrAlgorithm * \brief Set transmission power control * \param tpc TPC * \param num number of TPC configurations in the test case - * \param acculumatedMode whether TPC accumulated mode is used + * \param accumulatedMode whether TPC accumulated mode is used */ - void SetTpc(uint32_t tpc, uint32_t num, bool acculumatedMode); + void SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode); // inherited from LteFfrAlgorithm void SetLteFfrSapUser(LteFfrSapUser* s) override; diff --git a/src/lte/test/lte-simple-helper.cc b/src/lte/test/lte-simple-helper.cc index d64c8e114..e7964a2f9 100644 --- a/src/lte/test/lte-simple-helper.cc +++ b/src/lte/test/lte-simple-helper.cc @@ -14,7 +14,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Manuel Requena (Based on lte-helper.cc) + * Author: Manuel Requena + * (Based on lte-helper.cc) */ #include "lte-simple-helper.h" diff --git a/src/lte/test/lte-simple-helper.h b/src/lte/test/lte-simple-helper.h index 73754ef2e..59d18ae81 100644 --- a/src/lte/test/lte-simple-helper.h +++ b/src/lte/test/lte-simple-helper.h @@ -14,7 +14,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Manuel Requena (Based on lte-helper.h) + * Author: Manuel Requena + * (Based on lte-helper.h) */ #ifndef LTE_SIMPLE_HELPER_H diff --git a/src/lte/test/lte-test-entities.cc b/src/lte/test/lte-test-entities.cc index 86460b436..a6e8075bb 100644 --- a/src/lte/test/lte-test-entities.cc +++ b/src/lte/test/lte-test-entities.cc @@ -473,13 +473,13 @@ LteTestMac::SendTxOpportunity(Time time, uint32_t bytes) haveContext = true; } } - LteMacSapUser::TxOpportunityParameters txOpParmas; - txOpParmas.bytes = bytes; - txOpParmas.layer = 0; - txOpParmas.componentCarrierId = 0; - txOpParmas.harqId = 0; - txOpParmas.rnti = 0; - txOpParmas.lcid = 0; + LteMacSapUser::TxOpportunityParameters txOpParams; + txOpParams.bytes = bytes; + txOpParams.layer = 0; + txOpParams.componentCarrierId = 0; + txOpParams.harqId = 0; + txOpParams.rnti = 0; + txOpParams.lcid = 0; if (haveContext) { @@ -487,11 +487,11 @@ LteTestMac::SendTxOpportunity(Time time, uint32_t bytes) time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, - txOpParmas); + txOpParams); } else { - Simulator::Schedule(time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParmas); + Simulator::Schedule(time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParams); } if (m_txOpportunityMode == RANDOM_MODE) @@ -631,19 +631,19 @@ LteTestMac::DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters int32_t size = params.statusPduSize + params.txQueueSize + params.retxQueueSize; Time time = m_txOppTime; - LteMacSapUser::TxOpportunityParameters txOpParmas; - txOpParmas.bytes = m_txOppSize; - txOpParmas.layer = 0; - txOpParmas.componentCarrierId = 0; - txOpParmas.harqId = 0; - txOpParmas.rnti = params.rnti; - txOpParmas.lcid = params.lcid; + LteMacSapUser::TxOpportunityParameters txOpParams; + txOpParams.bytes = m_txOppSize; + txOpParams.layer = 0; + txOpParams.componentCarrierId = 0; + txOpParams.harqId = 0; + txOpParams.rnti = params.rnti; + txOpParams.lcid = params.lcid; while (size > 0) { EventId e = Simulator::Schedule(time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, - txOpParmas); + txOpParams); m_nextTxOppList.push_back(e); size -= m_txOppSize; time += m_txOppTime; diff --git a/src/lte/test/lte-test-frequency-reuse.cc b/src/lte/test/lte-test-frequency-reuse.cc index ed5456869..8cbccfef8 100644 --- a/src/lte/test/lte-test-frequency-reuse.cc +++ b/src/lte/test/lte-test-frequency-reuse.cc @@ -444,13 +444,13 @@ static LteFrequencyReuseTestSuite lteFrequencyReuseTestSuite; * TestCase Data */ void -DlDataRxStartNofitication(LteFrTestCase* testcase, Ptr spectrumValue) +DlDataRxStartNotification(LteFrTestCase* testcase, Ptr spectrumValue) { testcase->DlDataRxStart(spectrumValue); } void -UlDataRxStartNofitication(LteFrTestCase* testcase, Ptr spectrumValue) +UlDataRxStartNotification(LteFrTestCase* testcase, Ptr spectrumValue) { testcase->UlDataRxStart(spectrumValue); } @@ -617,7 +617,7 @@ LteHardFrTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofitication, this)); + MakeBoundCallback(&DlDataRxStartNotification, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs.Get(0) @@ -634,7 +634,7 @@ LteHardFrTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofitication, this)); + MakeBoundCallback(&UlDataRxStartNotification, this)); Simulator::Stop(Seconds(0.500)); Simulator::Run(); @@ -755,7 +755,7 @@ LteStrictFrTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofitication, this)); + MakeBoundCallback(&DlDataRxStartNotification, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs.Get(0) @@ -772,7 +772,7 @@ LteStrictFrTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofitication, this)); + MakeBoundCallback(&UlDataRxStartNotification, this)); Simulator::Stop(Seconds(0.500)); Simulator::Run(); @@ -785,13 +785,13 @@ LteStrictFrTestCase::DoRun() } void -DlDataRxStartNofiticationArea(LteFrAreaTestCase* testcase, Ptr spectrumValue) +DlDataRxStartNotificationArea(LteFrAreaTestCase* testcase, Ptr spectrumValue) { testcase->DlDataRxStart(spectrumValue); } void -UlDataRxStartNofiticationArea(LteFrAreaTestCase* testcase, Ptr spectrumValue) +UlDataRxStartNotificationArea(LteFrAreaTestCase* testcase, Ptr spectrumValue) { testcase->UlDataRxStart(spectrumValue); } @@ -1087,7 +1087,7 @@ LteStrictFrAreaTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&DlDataRxStartNotificationArea, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs1.Get(0) @@ -1106,7 +1106,7 @@ LteStrictFrAreaTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&UlDataRxStartNotificationArea, this)); std::vector expectedDlRbCenterArea; expectedDlRbCenterArea.resize(m_dlBandwidth, false); @@ -1303,7 +1303,7 @@ LteSoftFrAreaTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&DlDataRxStartNotificationArea, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs1.Get(0) @@ -1322,7 +1322,7 @@ LteSoftFrAreaTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&UlDataRxStartNotificationArea, this)); std::vector expectedDlRbCenterArea; expectedDlRbCenterArea.resize(m_dlBandwidth, false); @@ -1532,7 +1532,7 @@ LteSoftFfrAreaTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&DlDataRxStartNotificationArea, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs1.Get(0) @@ -1551,7 +1551,7 @@ LteSoftFfrAreaTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&UlDataRxStartNotificationArea, this)); double expectedDlPowerCenterArea = 0.5; std::vector expectedDlRbCenterArea; @@ -1803,7 +1803,7 @@ LteEnhancedFfrAreaTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&DlDataRxStartNotificationArea, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs1.Get(0) @@ -1822,7 +1822,7 @@ LteEnhancedFfrAreaTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&UlDataRxStartNotificationArea, this)); double expectedDlPowerCenterArea = 0.251189; std::vector expectedDlRbCenterArea; @@ -2184,7 +2184,7 @@ LteDistributedFfrAreaTestCase::DoRun() testDlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&DlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&DlDataRxStartNotificationArea, this)); // Test SpectrumPhy to get signals form UL channel Ptr ueUlSpectrumPhy = ueDevs1.Get(0) @@ -2203,7 +2203,7 @@ LteDistributedFfrAreaTestCase::DoRun() testUlSpectrumPhy->TraceConnectWithoutContext( "RxStart", - MakeBoundCallback(&UlDataRxStartNofiticationArea, this)); + MakeBoundCallback(&UlDataRxStartNotificationArea, this)); double expectedDlPowerCenterArea = 1.0; std::vector expectedDlRbCenterArea; diff --git a/src/lte/test/lte-test-interference-fr.cc b/src/lte/test/lte-test-interference-fr.cc index e6c231a3d..b3030b8e8 100644 --- a/src/lte/test/lte-test-interference-fr.cc +++ b/src/lte/test/lte-test-interference-fr.cc @@ -15,9 +15,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Piotr Gawlowicz - * Based on lte-test-interference.{h,cc} by Manuel Requena - * Nicola Baldo - * + * Based on lte-test-interference.{h,cc} by: + * Manuel Requena + * Nicola Baldo */ #include "lte-test-interference-fr.h" diff --git a/src/lte/test/lte-test-interference-fr.h b/src/lte/test/lte-test-interference-fr.h index 00f52a7ba..083c33970 100644 --- a/src/lte/test/lte-test-interference-fr.h +++ b/src/lte/test/lte-test-interference-fr.h @@ -15,9 +15,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Piotr Gawlowicz - * Based on lte-test-interference.{h,cc} by Manuel Requena - * Nicola Baldo - * + * Based on lte-test-interference.{h,cc} by: + * Manuel Requena + * Nicola Baldo */ #ifndef LTE_TEST_INTERFERENCE_FR_H diff --git a/src/lte/test/lte-test-rr-ff-mac-scheduler.cc b/src/lte/test/lte-test-rr-ff-mac-scheduler.cc index 531e2a248..218476ddd 100644 --- a/src/lte/test/lte-test-rr-ff-mac-scheduler.cc +++ b/src/lte/test/lte-test-rr-ff-mac-scheduler.cc @@ -306,7 +306,7 @@ LenaRrFfMacSchedulerTestCase::DoRun() std::vector dlDataRxed; if (m_errorModelEnabled) { - m_thrRefDl *= 0.95; // for couting the Vienna AMC behavior: BLER between 0% and 10% + m_thrRefDl *= 0.95; // for counting the Vienna AMC behavior: BLER between 0% and 10% } for (int i = 0; i < m_nUser; i++) { @@ -327,7 +327,7 @@ LenaRrFfMacSchedulerTestCase::DoRun() std::vector ulDataRxed; if (m_errorModelEnabled) { - m_thrRefUl *= 0.95; // for couting the Vienna AMC behavior: BLER between 0% and 10% + m_thrRefUl *= 0.95; // for counting the Vienna AMC behavior: BLER between 0% and 10% } for (int i = 0; i < m_nUser; i++) { diff --git a/src/lte/test/lte-test-run-time.pl b/src/lte/test/lte-test-run-time.pl index e0390cda9..9e3483a92 100755 --- a/src/lte/test/lte-test-run-time.pl +++ b/src/lte/test/lte-test-run-time.pl @@ -13,7 +13,7 @@ my @nEnb = (1, 2, 4, 6, 8, 12, 14, 18, 22); my @nFloors = (0, 1); my @simTime = (5, 10); -# Configure and complite first the program to avoid counting compilation time as running time +# Configure and compile first the program to avoid counting compilation time as running time my $launch = "CXXFLAGS=\"-O3 -w\" ./ns3 configure -d optimized --enable-static --enable-examples --enable-modules=lte"; my $out; my $err; diff --git a/src/lte/test/lte-test-spectrum-value-helper.cc b/src/lte/test/lte-test-spectrum-value-helper.cc index 127423f49..4e8c04e40 100644 --- a/src/lte/test/lte-test-spectrum-value-helper.cc +++ b/src/lte/test/lte-test-spectrum-value-helper.cc @@ -155,7 +155,7 @@ class LteTxPsdTestCase : public TestCase * \param str the reference name * \param earfcn * \param bw bandwidth - * \param txPowerDbm tranmit power in dBm + * \param txPowerDbm transmit power in dBm * \param activeRbs active RBs * \param expected executed spectrum value */ diff --git a/src/lte/test/lte-test-ue-phy.h b/src/lte/test/lte-test-ue-phy.h index d23e30aaa..7a7677dd4 100644 --- a/src/lte/test/lte-test-ue-phy.h +++ b/src/lte/test/lte-test-ue-phy.h @@ -14,7 +14,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Author: Manuel Requena : Based on lte-ue-phy code + * Author: Manuel Requena + * (Based on lte-ue-phy code) */ #ifndef LTE_TEST_UE_PHY_H diff --git a/src/lte/test/lte-test-uplink-power-control.cc b/src/lte/test/lte-test-uplink-power-control.cc index 9e37e8599..d18f3d985 100644 --- a/src/lte/test/lte-test-uplink-power-control.cc +++ b/src/lte/test/lte-test-uplink-power-control.cc @@ -78,7 +78,7 @@ static LteUplinkPowerControlTestSuite lteUplinkPowerControlTestSuite; * TestCase Data */ void -PuschTxPowerNofitication(LteUplinkPowerControlTestCase* testcase, +PuschTxPowerNotification(LteUplinkPowerControlTestCase* testcase, uint16_t cellId, uint16_t rnti, double txPower) @@ -87,7 +87,7 @@ PuschTxPowerNofitication(LteUplinkPowerControlTestCase* testcase, } void -PucchTxPowerNofitication(LteUplinkPowerControlTestCase* testcase, +PucchTxPowerNotification(LteUplinkPowerControlTestCase* testcase, uint16_t cellId, uint16_t rnti, double txPower) @@ -96,7 +96,7 @@ PucchTxPowerNofitication(LteUplinkPowerControlTestCase* testcase, } void -SrsTxPowerNofitication(LteUplinkPowerControlTestCase* testcase, +SrsTxPowerNotification(LteUplinkPowerControlTestCase* testcase, uint16_t cellId, uint16_t rnti, double txPower) @@ -269,11 +269,11 @@ LteUplinkOpenLoopPowerControlTestCase::DoRun() m_ueUpc = uePhy->GetUplinkPowerControl(); m_ueUpc->TraceConnectWithoutContext("ReportPuschTxPower", - MakeBoundCallback(&PuschTxPowerNofitication, this)); + MakeBoundCallback(&PuschTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportPucchTxPower", - MakeBoundCallback(&PucchTxPowerNofitication, this)); + MakeBoundCallback(&PucchTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportSrsTxPower", - MakeBoundCallback(&SrsTxPowerNofitication, this)); + MakeBoundCallback(&SrsTxPowerNotification, this)); // Attach a UE to a eNB lteHelper->Attach(ueDevs, enbDevs.Get(0)); @@ -452,11 +452,11 @@ LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun() m_ueUpc = uePhy->GetUplinkPowerControl(); m_ueUpc->TraceConnectWithoutContext("ReportPuschTxPower", - MakeBoundCallback(&PuschTxPowerNofitication, this)); + MakeBoundCallback(&PuschTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportPucchTxPower", - MakeBoundCallback(&PucchTxPowerNofitication, this)); + MakeBoundCallback(&PucchTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportSrsTxPower", - MakeBoundCallback(&SrsTxPowerNofitication, this)); + MakeBoundCallback(&SrsTxPowerNotification, this)); // Attach a UE to a eNB lteHelper->Attach(ueDevs, enbDevs.Get(0)); @@ -616,11 +616,11 @@ LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun() m_ueUpc = uePhy->GetUplinkPowerControl(); m_ueUpc->TraceConnectWithoutContext("ReportPuschTxPower", - MakeBoundCallback(&PuschTxPowerNofitication, this)); + MakeBoundCallback(&PuschTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportPucchTxPower", - MakeBoundCallback(&PucchTxPowerNofitication, this)); + MakeBoundCallback(&PucchTxPowerNotification, this)); m_ueUpc->TraceConnectWithoutContext("ReportSrsTxPower", - MakeBoundCallback(&SrsTxPowerNofitication, this)); + MakeBoundCallback(&SrsTxPowerNotification, this)); // Attach a UE to a eNB lteHelper->Attach(ueDevs, enbDevs.Get(0)); diff --git a/src/lte/test/test-epc-tft-classifier.cc b/src/lte/test/test-epc-tft-classifier.cc index ec58896d5..0b32a3538 100644 --- a/src/lte/test/test-epc-tft-classifier.cc +++ b/src/lte/test/test-epc-tft-classifier.cc @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Manuel Requena + * Authors: + * Nicola Baldo + * Manuel Requena */ #include "ns3/epc-tft-classifier.h" diff --git a/src/lte/test/test-lte-x2-handover-measures.cc b/src/lte/test/test-lte-x2-handover-measures.cc index 09db4e31d..9d54ac368 100644 --- a/src/lte/test/test-lte-x2-handover-measures.cc +++ b/src/lte/test/test-lte-x2-handover-measures.cc @@ -14,8 +14,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Authors: Nicola Baldo - * Manuel Requena + * Authors: + * Nicola Baldo + * Manuel Requena */ #include diff --git a/src/mesh/model/mesh-point-device.cc b/src/mesh/model/mesh-point-device.cc index 8e6bc37d1..56de2a3c6 100644 --- a/src/mesh/model/mesh-point-device.cc +++ b/src/mesh/model/mesh-point-device.cc @@ -174,16 +174,16 @@ MeshPointDevice::ReceiveFromDevice(Ptr incomingPort, } void -MeshPointDevice::Forward(Ptr inport, +MeshPointDevice::Forward(Ptr incomingPort, Ptr packet, uint16_t protocol, const Mac48Address src, const Mac48Address dst) { - NS_LOG_FUNCTION(this << inport << packet << protocol << src << dst); + NS_LOG_FUNCTION(this << incomingPort << packet << protocol << src << dst); // pass through routing protocol NS_LOG_DEBUG("Forwarding from " << src << " to " << dst << " at " << m_address); - bool result = m_routingProtocol->RequestRoute(inport->GetIfIndex(), + bool result = m_routingProtocol->RequestRoute(incomingPort->GetIfIndex(), src, dst, packet, diff --git a/src/mobility/examples/reference-point-group-mobility-example.cc b/src/mobility/examples/reference-point-group-mobility-example.cc index d2b63f295..53026eccd 100644 --- a/src/mobility/examples/reference-point-group-mobility-example.cc +++ b/src/mobility/examples/reference-point-group-mobility-example.cc @@ -33,7 +33,7 @@ * and different child mobility models. * * There is no node associated with the parent (reference) model. - * Instead, all nodes are associated with a hiearchical mobility model + * Instead, all nodes are associated with a hierarchical mobility model * containing both the parent and child models, and the position of * the node is the vector sum of these parent and child positions. * diff --git a/src/mobility/helper/ns2-mobility-helper.cc b/src/mobility/helper/ns2-mobility-helper.cc index 790a662f8..acd5182a7 100644 --- a/src/mobility/helper/ns2-mobility-helper.cc +++ b/src/mobility/helper/ns2-mobility-helper.cc @@ -854,7 +854,7 @@ SetSchedPosition(Ptr model, position.y = model->GetPosition().y; position.z = model->GetPosition().z; - // Chedule next positions + // Schedule next positions Simulator::Schedule(Seconds(at), &ConstantVelocityMobilityModel::SetPosition, model, position); return position; diff --git a/src/network/utils/queue-size.cc b/src/network/utils/queue-size.cc index 6c5fbb160..54c91b843 100644 --- a/src/network/utils/queue-size.cc +++ b/src/network/utils/queue-size.cc @@ -1,21 +1,21 @@ -// -// Copyright (c) 2018 Universita' degli Studi di Napoli Federico II -// -// 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: Stefano Avallone -// +/* + * Copyright (c) 2018 Universita' degli Studi di Napoli Federico II + * + * 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: Stefano Avallone + */ #include "queue-size.h" diff --git a/src/network/utils/queue-size.h b/src/network/utils/queue-size.h index 832ab0f2d..274400e86 100644 --- a/src/network/utils/queue-size.h +++ b/src/network/utils/queue-size.h @@ -1,21 +1,21 @@ -// -// Copyright (c) 2018 Universita' degli Studi di Napoli Federico II -// -// 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: Stefano Avallone -// +/* + * Copyright (c) 2018 Universita' degli Studi di Napoli Federico II + * + * 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: Stefano Avallone + */ #ifndef QUEUE_SIZE_H #define QUEUE_SIZE_H diff --git a/src/propagation/doc/propagation.rst b/src/propagation/doc/propagation.rst index 1e45fa0e7..1eb5ce137 100644 --- a/src/propagation/doc/propagation.rst +++ b/src/propagation/doc/propagation.rst @@ -410,7 +410,7 @@ The extension for the standard OH in open area is The literature lacks of extensions of the COST231 to open area (for suburban it seems that -we can just impose C = 0); therefore we consider it a special case fo the suburban one. +we can just impose C = 0); therefore we consider it a special case of the suburban one. Cost231PropagationLossModel diff --git a/src/propagation/model/channel-condition-model.cc b/src/propagation/model/channel-condition-model.cc index bbac4db2b..08604e5a8 100644 --- a/src/propagation/model/channel-condition-model.cc +++ b/src/propagation/model/channel-condition-model.cc @@ -686,7 +686,7 @@ ThreeGppUmiStreetCanyonChannelConditionModel::ComputePlos(PtrGetPosition(), b->GetPosition()); - // NOTE: no idication is given about the UT height used to derive the + // NOTE: no indication is given about the UT height used to derive the // LOS probability // h_BS should be equal to 10 m. We check if at least one of the two @@ -741,7 +741,7 @@ ThreeGppIndoorMixedOfficeChannelConditionModel::ComputePlos(PtrGetPosition(), b->GetPosition()); - // NOTE: no idication is given about the UT height used to derive the + // NOTE: no indication is given about the UT height used to derive the // LOS probability // retrieve h_BS, it should be equal to 3 m @@ -800,7 +800,7 @@ ThreeGppIndoorOpenOfficeChannelConditionModel::ComputePlos(PtrGetPosition(), b->GetPosition()); - // NOTE: no idication is given about the UT height used to derive the + // NOTE: no indication is given about the UT height used to derive the // LOS probability // retrieve h_BS, it should be equal to 3 m diff --git a/src/spectrum/test/two-ray-splm-test-suite.cc b/src/spectrum/test/two-ray-splm-test-suite.cc index 4ed3d37bc..e5deb9418 100644 --- a/src/spectrum/test/two-ray-splm-test-suite.cc +++ b/src/spectrum/test/two-ray-splm-test-suite.cc @@ -259,7 +259,7 @@ ArrayResponseTest::ArrayResponseTest(Ptr txAntElem, double expectedGain) // TODO: Create a string with the test parameters as the test case name like in // test-uniform-planar-array ? - : TestCase("Check that the overall array response gain has the proper trend with respect to" + : TestCase("Check that the overall array response gain has the proper trend with respect to " "the number of antennas and the type of single element antenna"), m_txAntElem(txAntElem), m_rxAntElem(rxAntElem), diff --git a/src/traffic-control/doc/fq-cobalt.rst b/src/traffic-control/doc/fq-cobalt.rst index 3422fef44..8d823eb51 100644 --- a/src/traffic-control/doc/fq-cobalt.rst +++ b/src/traffic-control/doc/fq-cobalt.rst @@ -32,7 +32,7 @@ The Model Description is similar to the FqCoDel documentation mentioned above. References ========== -.. [Pal19] J. Palmei, S. Gupta, P. Imputato, J. Morton, M. Tahiliani, S. Avallone, and D. Taht, Design and Evaluation of COBALT Queue Discipline, 2019 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN), Paris, France, 2019. +.. [Pal19] J. Palmei, S. Gupta, P. Imputato, J. Morton, M. Tahiliani, S. Avallone, and D. Taht, Design and Evaluation of COBALT Queue Discipline, 2019 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN), Paris, France, 2019. .. [Hoe18] T. Hoiland-Jørgensen, D. Taht and J. Morton, "Piece of CAKE: A Comprehensive Queue Management Solution for Home Gateways," 2018 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN), Washington, DC, USA, 2018. diff --git a/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc b/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc index 0437aa101..dcbc814fb 100644 --- a/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc +++ b/src/traffic-control/examples/codel-vs-pfifo-asymmetric.cc @@ -260,7 +260,7 @@ TraceDroppingState(std::string dropStateTrFileName) * * \param remoteAddress Remote address. * \param sender Sender node. - * \param pktSize Pakcet size. + * \param pktSize Packet size. * \param stopTime Stop time. */ void diff --git a/src/traffic-control/model/codel-queue-disc.cc b/src/traffic-control/model/codel-queue-disc.cc index d66257edd..da2975de6 100644 --- a/src/traffic-control/model/codel-queue-disc.cc +++ b/src/traffic-control/model/codel-queue-disc.cc @@ -18,8 +18,9 @@ * Based on ns2 simulation code presented by Kathie Nichols * * This port based on linux kernel code by - * Authors: Dave Täht - * Eric Dumazet + * Authors: + * Dave Täht + * Eric Dumazet * * Ported to ns-3 by: Andrew McGregor */ diff --git a/src/traffic-control/model/codel-queue-disc.h b/src/traffic-control/model/codel-queue-disc.h index c6535cb3b..9a26bc3b4 100644 --- a/src/traffic-control/model/codel-queue-disc.h +++ b/src/traffic-control/model/codel-queue-disc.h @@ -18,8 +18,9 @@ * Based on ns2 simulation code presented by Kathie Nichols * * This port based on linux kernel code by - * Authors: Dave Täht - * Eric Dumazet + * Authors: + * Dave Täht + * Eric Dumazet * * Ported to ns-3 by: Andrew McGregor */ diff --git a/src/uan/model/uan-mac-rc.h b/src/uan/model/uan-mac-rc.h index 2b203bf4e..dd58b83b8 100644 --- a/src/uan/model/uan-mac-rc.h +++ b/src/uan/model/uan-mac-rc.h @@ -125,7 +125,7 @@ class Reservation /** * Set the reservation transmitted state. * - * \param t True if resevation has been transmitted. + * \param t True if reservation has been transmitted. */ void SetTransmitted(bool t = true); diff --git a/src/wifi/doc/source/wifi-design.rst b/src/wifi/doc/source/wifi-design.rst index 598ee8fe4..af7259887 100644 --- a/src/wifi/doc/source/wifi-design.rst +++ b/src/wifi/doc/source/wifi-design.rst @@ -1396,7 +1396,7 @@ Depending on your goal, the common tasks are (in no particular order): * Wi-Fi queue management. The files ``txop.*`` and ``qos-txop.*`` are of interest for this task. * Channel access management. Users should modify the files ``channel-access-manager.*``, which grant access to ``Txop`` and ``QosTxop``. -* Fragmentation and RTS threholds are handled by Wi-Fi remote station manager. Note that Wi-Fi remote +* Fragmentation and RTS thresholds are handled by Wi-Fi remote station manager. Note that Wi-Fi remote station manager simply indicates if fragmentation and RTS are needed. Fragmentation is handled by ``Txop`` or ``QosTxop`` while RTS/CTS transaction is handled by ``FrameExchangeManager``. * Modifying or creating new rate control algorithms can be done by creating a new child class of Wi-Fi remote diff --git a/src/wifi/examples/reference/bianchi11ax.py b/src/wifi/examples/reference/bianchi11ax.py index b06f807b9..5f8b5c953 100644 --- a/src/wifi/examples/reference/bianchi11ax.py +++ b/src/wifi/examples/reference/bianchi11ax.py @@ -129,39 +129,39 @@ ack_rates_160MHz = [6e6, 12e6, 12e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 2 k = 1 difs = 1 -with open("bianchi_11ax_difs.txt", "w", encoding="utf-8") as fo: +with open("bianchi_11ax_difs.txt", "w", encoding="utf-8") as f: for i in range(len(data_rates_20MHz)): bianchi_result = bianchi_ax(data_rates_20MHz[i], ack_rates_20MHz[i], k, difs) str_s = str_result(bianchi_result, i, 20) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_40MHz)): bianchi_result = bianchi_ax(data_rates_40MHz[i], ack_rates_40MHz[i], k, difs) str_s = str_result(bianchi_result, i, 40) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_80MHz)): bianchi_result = bianchi_ax(data_rates_80MHz[i], ack_rates_80MHz[i], k, difs) str_s = str_result(bianchi_result, i, 80) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_160MHz)): bianchi_result = bianchi_ax(data_rates_160MHz[i], ack_rates_160MHz[i], k, difs) str_s = str_result(bianchi_result, i, 160) - fo.write(str_s) + f.write(str_s) difs = 0 -with open("bianchi_11ax_eifs.txt", "w", encoding="utf-8") as fo: +with open("bianchi_11ax_eifs.txt", "w", encoding="utf-8") as f: for i in range(len(data_rates_20MHz)): bianchi_result = bianchi_ax(data_rates_20MHz[i], ack_rates_20MHz[i], k, difs) str_s = str_result(bianchi_result, i, 20) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_40MHz)): bianchi_result = bianchi_ax(data_rates_40MHz[i], ack_rates_40MHz[i], k, difs) str_s = str_result(bianchi_result, i, 40) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_80MHz)): bianchi_result = bianchi_ax(data_rates_80MHz[i], ack_rates_80MHz[i], k, difs) str_s = str_result(bianchi_result, i, 80) - fo.write(str_s) + f.write(str_s) for i in range(len(data_rates_160MHz)): bianchi_result = bianchi_ax(data_rates_160MHz[i], ack_rates_160MHz[i], k, difs) str_s = str_result(bianchi_result, i, 160) - fo.write(str_s) + f.write(str_s) diff --git a/src/wimax/model/bs-net-device.h b/src/wimax/model/bs-net-device.h index be968a09c..0b0e5c26d 100644 --- a/src/wimax/model/bs-net-device.h +++ b/src/wimax/model/bs-net-device.h @@ -492,7 +492,7 @@ class BaseStationNetDevice : public WimaxNetDevice * \see class CallBackTraceSource */ TracedCallback> - m_bsPromiscRxTrace; ///< base station promiscious receive trace callback + m_bsPromiscRxTrace; ///< base station promiscuous receive trace callback /** * The trace source fired for packets successfully received by the device diff --git a/src/wimax/model/wimax-net-device.h b/src/wimax/model/wimax-net-device.h index 7e2bc648c..1c4910028 100644 --- a/src/wimax/model/wimax-net-device.h +++ b/src/wimax/model/wimax-net-device.h @@ -211,7 +211,7 @@ class WimaxNetDevice : public NetDevice /** * Set the connection manager of the device - * \param connectionManager the commection manager to be installed in the device + * \param connectionManager the connection manager to be installed in the device */ virtual void SetConnectionManager(Ptr connectionManager); @@ -421,13 +421,13 @@ class WimaxNetDevice : public NetDevice const Address& dest, uint16_t protocolNumber) override; /** - * Set promiscious receive callback function - * \param cb the promiscious mode callback + * Set promiscuous receive callback function + * \param cb the promiscuous mode callback */ void SetPromiscReceiveCallback(PromiscReceiveCallback cb) override; /** - * Get promiscious receive callback function - * \returns the promiscious mode callback + * Get promiscuous receive callback function + * \returns the promiscuous mode callback */ NetDevice::PromiscReceiveCallback GetPromiscReceiveCallback(); /** @@ -470,12 +470,12 @@ class WimaxNetDevice : public NetDevice bool IsBridge() const override; /** - * Check if device is promiscious - * \returns true if promiscious + * Check if device is promiscuous + * \returns true if promiscuous */ bool IsPromisc(); /** - * Notify promiscious trace of a packet arrival + * Notify promiscuous trace of a packet arrival * \param p the packet */ void NotifyPromiscTrace(Ptr p); @@ -527,7 +527,7 @@ class WimaxNetDevice : public NetDevice Ptr m_node; ///< the node Ptr m_phy; ///< the phy NetDevice::ReceiveCallback m_forwardUp; ///< forward up callback function - NetDevice::PromiscReceiveCallback m_promiscRx; ///< promiscious receive fcallback function + NetDevice::PromiscReceiveCallback m_promiscRx; ///< promiscuous receive callback function uint32_t m_ifIndex; ///< IF index std::string m_name; ///< service name diff --git a/utils/bench-scheduler.cc b/utils/bench-scheduler.cc index 2cfbaf1fa..7cbb326b8 100644 --- a/utils/bench-scheduler.cc +++ b/utils/bench-scheduler.cc @@ -479,10 +479,10 @@ main(int argc, char* argv[]) "\n" "If no scheduler is specified the MapScheduler will be run."); cmd.AddValue("all", "use all schedulers", allSched); - cmd.AddValue("cal", "use CalendarSheduler", schedCal); + cmd.AddValue("cal", "use CalendarScheduler", schedCal); cmd.AddValue("calrev", "reverse ordering in the CalendarScheduler", calRev); cmd.AddValue("heap", "use HeapScheduler", schedHeap); - cmd.AddValue("list", "use ListSheduler", schedList); + cmd.AddValue("list", "use ListScheduler", schedList); cmd.AddValue("map", "use MapScheduler (default)", schedMap); cmd.AddValue("pri", "use PriorityQueue", schedPQ); cmd.AddValue("debug", "enable debugging output", g_debug); diff --git a/utils/codespell-ignored-lines b/utils/codespell-ignored-lines index 736a234a3..b38136e3f 100644 --- a/utils/codespell-ignored-lines +++ b/utils/codespell-ignored-lines @@ -49,6 +49,42 @@ Network Animator nam. It is not possible to run a simulation arp_h->ar_tha); // Target hardware address. arp_h->ar_hln = sizeof arp_h->ar_tha; // Hardware address length. +# Names and emails + * Author: Manuel Requena + * Manuel Requena + * Dave Täht +.. [Pal19] J. Palmei, S. Gupta, P. Imputato, J. Morton, M. Tahiliani, S. Avallone, and D. Taht, Design and Evaluation of COBALT Queue Discipline, 2019 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN), Paris, France, 2019. +.. [Hoe18] T. Hoiland-Jørgensen, D. Taht and J. Morton, "Piece of CAKE: A Comprehensive Queue Management Solution for Home Gateways," 2018 IEEE International Symposium on Local and Metropolitan Area Networks (LANMAN), Washington, DC, USA, 2018. +.. [Hoe16] T. Hoeiland-Joergensen, P. McKenney, D. Taht, J. Gettys and E. Dumazet, The FlowQueue-CoDel Packet Scheduler and Active Queue Management Algorithm, IETF draft. Available online at ``_ + Morton, Mohit P. Tahiliani, Stefano Avallone and Dave Taht (2019). + * Author: Jaume Nin + * Jaume Nin + * Author: Jaume Nin + * Jaume Nin + * Author: Jaume Nin + * Author: Jaume Nin + * Jaume Nin + * Copyright (c) 2014 Universita' degli Studi di Napoli "Federico II" + * 2014 Universita' degli Studi di Napoli "Federico II" + * Copyright (c) 2015 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2015 Universita' degli Studi di Napoli "Federico II" + * 2015 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2017 Universita' degli Studi di Napoli Federico II + * 2017 Università' degli Studi di Napoli Federico II + * 2017 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2018 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2019 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2021 2020 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2022 Universita' degli Studi di Napoli Federico II + * Copyright (c) 2022 Universita' degli Studi di Napoli "Federico II" + * Copyright (c) 2023 Universita' degli Studi di Napoli Federico II + +./src/core/examples/hash-example.cc +6ed21de2 brand-newness peripherial + ./src/dsr/model/dsr-routing.cc:243, 246, 3360, 3363 .AddAttribute("GratReplyHoldoff", MakeTimeAccessor(&DsrRouting::m_gratReplyHoldoff), @@ -95,6 +131,10 @@ static ns3::GlobalValue g_rate("VRCrate", ./src/internet/model/global-route-manager-impl.h:555 typedef std::list ListOfSPFVertex_t; //!< container of SPFVertexes +./utils/tests/test-ns3.py + destination_src = os.path.join(ns3_path, "src/test-src-dependant-on-contrib") + shutil.copytree(os.path.join(ns3_path, "build-support/test-files/test-src-dependant-on-contrib"), + ./CHANGES.md: * (dsr) Class `DsrOptionRerrUnsupportHeader` from `dsr-option-header.h` was renamed `DsrOptionRerrUnsupportedHeader`. * (internet) Enumerated value `IPV6_EXT_AUTHENTIFICATION` from `ipv6-header.h` was renamed `IPV6_EXT_AUTHENTICATION`. @@ -117,5 +157,8 @@ static ns3::GlobalValue g_rate("VRCrate", * (wifi) Enumerated value `MDAOP_ADVERTISMENTS` from `mgmt-headers.h` was renamed `MDAOP_ADVERTISEMENTS`. * (wifi) Define `IE_BEAMLINK_MAINENANCE` from `wifi-information-element.h` was renamed `IE_BEAMLINK_MAINTENANCE`. * (wimax) Attribute `m_nrRecivedFecBlocks` from `simple-ofdm-wimax-phy.h` was renamed `m_nrReceivedFecBlocks`. + * (lte) Struct member `fdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `fdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + * (lte) Struct member `tdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `tdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + * (lte) Struct member `pfsFlowPerf_t::lastTtiBytesTrasmitted` in file `pf-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. * 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. * 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 04b6ccd87..eac37a4b4 100644 --- a/utils/codespell-ignored-words +++ b/utils/codespell-ignored-words @@ -2,81 +2,40 @@ te #Core -anid -anumber bu mone -peripherial -studi -thre #Network ot nd #Internet -devicec ect iif -nce -inflight -upto - -#Internet Apps -clen - -#Buildings -nin #DSR -cleanp grat #LTE commun -couting ue ues -#Netanim -writen - -#Spectrum -inh - -#Wave -aci -ois - -#Wifi -fo - #Traffic Control -taht interm +#Wi-Fi +aci + #Wimax aas opps -#Propagation -alos -clos - -#Examples -clienta - #Brite brite -#Mesh -inport - #Visualizer inout #Utils filetest - -#test-ns3.py -dependant diff --git a/utils/tests/README.md b/utils/tests/README.md index 0fabbcf82..a478ca404 100644 --- a/utils/tests/README.md +++ b/utils/tests/README.md @@ -27,7 +27,7 @@ The configuration is split in different files, each one containing a group of jo - `gitlab-ci-scheduled.yml`: daily and weekly ordinary and slow jobs. - `gitlab-ci-gcc.yml`: jobs to test various GCC versions. -If you did fork ns-3, the CI should already point to the right configureation file. Otherwise, you will have to select the `gitlab-ci.yml` in your fork configuration. Note that Gitlab requires a user verification (usually it requires a valid credit card) to run CI jobs. If you did skip the verification process the CI will always fail. +If you did fork ns-3, the CI should already point to the right configuration file. Otherwise, you will have to select the `gitlab-ci.yml` in your fork configuration. Note that Gitlab requires a user verification (usually it requires a valid credit card) to run CI jobs. If you did skip the verification process the CI will always fail. ### CI pipelines From 2d0a2f564aec3eba21b741b54fb8ed8be17d3444 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Mon, 2 Oct 2023 23:01:19 +0200 Subject: [PATCH 005/379] network: clarify socket creation error message --- src/network/model/socket.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/model/socket.cc b/src/network/model/socket.cc index 064f0ff94..869efc8dd 100644 --- a/src/network/model/socket.cc +++ b/src/network/model/socket.cc @@ -73,9 +73,11 @@ Socket::CreateSocket(Ptr node, TypeId tid) { NS_LOG_FUNCTION(node << tid); Ptr s; - NS_ASSERT(node); + NS_ASSERT_MSG(node, "CreateSocket: node is null."); Ptr socketFactory = node->GetObject(tid); - NS_ASSERT(socketFactory); + NS_ASSERT_MSG(socketFactory, + "CreateSocket: can not create a " + << tid.GetName() << " - perhaps the node is missing the required protocol."); s = socketFactory->CreateSocket(); NS_ASSERT(s); return s; From c4c866aa9733af71a3d8be753f4f16213911de06 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Fri, 29 Sep 2023 15:17:47 +0100 Subject: [PATCH 006/379] check-style: Allow passing multiple paths as argument --- utils/check-style-clang-format.py | 44 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/utils/check-style-clang-format.py b/utils/check-style-clang-format.py index f78ba7703..e4b118e0f 100755 --- a/utils/check-style-clang-format.py +++ b/utils/check-style-clang-format.py @@ -169,11 +169,11 @@ def should_analyze_file(path: str, extension in file_extensions_to_check) -def find_files_to_check_style(path: str) -> Tuple[List[str], List[str], List[str], List[str]]: +def find_files_to_check_style(paths: List[str]) -> Tuple[List[str], List[str], List[str], List[str]]: """ - Find all files to be checked in a given path. + Find all files to be checked in a given list of paths. - @param path Path to check. + @param paths List of paths to the files to check. @return Tuple [List of files to check include prefixes, List of files to check formatting, List of files to check trailing whitespace, @@ -181,22 +181,24 @@ def find_files_to_check_style(path: str) -> Tuple[List[str], List[str], List[str """ files_to_check: List[str] = [] - abs_path = os.path.abspath(os.path.expanduser(path)) - if os.path.isfile(abs_path): - files_to_check = [path] + for path in paths: + abs_path = os.path.abspath(os.path.expanduser(path)) - elif os.path.isdir(abs_path): - for dirpath, dirnames, filenames in os.walk(path, topdown=True): - if not should_analyze_directory(dirpath): - # Remove directory and its subdirectories - dirnames[:] = [] - continue + if os.path.isfile(abs_path): + files_to_check.append(path) - files_to_check.extend([os.path.join(dirpath, f) for f in filenames]) + elif os.path.isdir(abs_path): + for dirpath, dirnames, filenames in os.walk(path, topdown=True): + if not should_analyze_directory(dirpath): + # Remove directory and its subdirectories + dirnames[:] = [] + continue - else: - raise ValueError(f'Error: {path} is not a file nor a directory') + files_to_check.extend([os.path.join(dirpath, f) for f in filenames]) + + else: + raise ValueError(f'Error: {path} is not a file nor a directory') files_to_check.sort() @@ -268,7 +270,7 @@ def find_clang_format_path() -> str: ########################################################### # CHECK STYLE MAIN FUNCTIONS ########################################################### -def check_style_clang_format(path: str, +def check_style_clang_format(paths: List[str], enable_check_include_prefixes: bool, enable_check_formatting: bool, enable_check_whitespace: bool, @@ -280,7 +282,7 @@ def check_style_clang_format(path: str, """ Check / fix the coding style of a list of files. - @param path Path to the files. + @param paths List of paths to the files to check. @param enable_check_include_prefixes Whether to enable checking #include headers from the same module with the "ns3/" prefix. @param enable_check_formatting Whether to enable checking code formatting. @param enable_check_whitespace Whether to enable checking trailing whitespace. @@ -294,7 +296,7 @@ def check_style_clang_format(path: str, (files_to_check_include_prefixes, files_to_check_formatting, files_to_check_whitespace, - files_to_check_tabs) = find_files_to_check_style(path) + files_to_check_tabs) = find_files_to_check_style(paths) check_include_prefixes_successful = True check_formatting_successful = True @@ -688,8 +690,8 @@ if __name__ == '__main__': 'If it detects non-formatted files, they will be printed and this process exits with a ' 'non-zero code. When used in "fix mode", this script automatically fixes the files.') - parser.add_argument('path', action='store', type=str, - help='Path to the files to check') + parser.add_argument('paths', action='store', type=str, nargs='+', + help='List of paths to the files to check') parser.add_argument('--no-include-prefixes', action='store_true', help='Do not check / fix #include headers from the same module with the "ns3/" prefix') @@ -716,7 +718,7 @@ if __name__ == '__main__': try: all_checks_successful = check_style_clang_format( - path=args.path, + paths=args.paths, enable_check_include_prefixes=(not args.no_include_prefixes), enable_check_formatting=(not args.no_formatting), enable_check_whitespace=(not args.no_whitespace), From da6c3e5e0341f3816724ed1abc16036c0b805dd8 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Fri, 29 Sep 2023 15:24:26 +0100 Subject: [PATCH 007/379] ci: Join two calls to check-style-clang-format.py in one line --- utils/tests/gitlab-ci-doc.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/utils/tests/gitlab-ci-doc.yml b/utils/tests/gitlab-ci-doc.yml index e3ac3ac2d..f0d0b5076 100644 --- a/utils/tests/gitlab-ci-doc.yml +++ b/utils/tests/gitlab-ci-doc.yml @@ -46,8 +46,7 @@ doxygen: # - doc/doxygen.warnings.report.sh -f "$CHANGED_FILES" - doc/doxygen.warnings.report.sh # Just need to check doc/introspected-command-line.h and doc/introspected-doxygen.h - - python3 utils/check-style-clang-format.py --no-formatting --no-tabs doc/introspected-doxygen.h - - python3 utils/check-style-clang-format.py --no-formatting --no-tabs doc/introspected-command-line.h + - python3 utils/check-style-clang-format.py --no-formatting --no-tabs doc/introspected-doxygen.h doc/introspected-command-line.h - ./ns3 clean # - doxygen doc/doxygen.conf # - mv doc/html/ public/doxygen From b1f2afc372a0e455c5752ea04c123f6d09f2dbc4 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Thu, 21 Sep 2023 20:58:52 +0100 Subject: [PATCH 008/379] core: (fixes #812) Fix variable overwrite in RealtimeSimulatorImpl::Run() Thanks to Peter Barnes --- src/core/model/realtime-simulator-impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/model/realtime-simulator-impl.cc b/src/core/model/realtime-simulator-impl.cc index 9c4152dc6..bfad0adc3 100644 --- a/src/core/model/realtime-simulator-impl.cc +++ b/src/core/model/realtime-simulator-impl.cc @@ -456,7 +456,7 @@ RealtimeSimulatorImpl::Run() if (!process) { // Sleep until signalled - tsNow = m_synchronizer->Synchronize(tsNow, tsDelay); + m_synchronizer->Synchronize(tsNow, tsDelay); // Re-check event queue continue; From 53c8c975b2480a8e395dc8c2d3f4fd55483ef044 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Thu, 21 Sep 2023 21:13:06 +0100 Subject: [PATCH 009/379] core: Simplify code of RealtimeSimulatorImpl::Run() Thanks to Peter Barnes --- src/core/model/realtime-simulator-impl.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/model/realtime-simulator-impl.cc b/src/core/model/realtime-simulator-impl.cc index bfad0adc3..757eb9ff5 100644 --- a/src/core/model/realtime-simulator-impl.cc +++ b/src/core/model/realtime-simulator-impl.cc @@ -453,16 +453,15 @@ RealtimeSimulatorImpl::Run() } } - if (!process) + if (process) { - // Sleep until signalled - m_synchronizer->Synchronize(tsNow, tsDelay); - - // Re-check event queue - continue; + ProcessOneEvent(); + } + else + { + // Sleep until signalled and re-check event queue + m_synchronizer->Synchronize(tsNow, tsDelay); } - - ProcessOneEvent(); } // From 8a0dae335aa63029c6c70240c0bc0dde50943c14 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 20 Sep 2023 03:30:52 +0100 Subject: [PATCH 010/379] core, wimax: Fix clang-tidy readability-implicit-bool-conversion warnings --- src/core/model/int64x64-128.cc | 2 +- src/wimax/model/ss-net-device.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/model/int64x64-128.cc b/src/core/model/int64x64-128.cc index 38e1cfbd9..daf105741 100644 --- a/src/core/model/int64x64-128.cc +++ b/src/core/model/int64x64-128.cc @@ -225,7 +225,7 @@ int64x64_t::Invert(const uint64_t v) a <<= 64; int64x64_t result; result._v = Udiv(a, v); - int64x64_t tmp = int64x64_t(v, false); + int64x64_t tmp(v, 0); tmp.MulByInvert(result); if (tmp.GetHigh() != 1) { diff --git a/src/wimax/model/ss-net-device.cc b/src/wimax/model/ss-net-device.cc index 9b0fd4106..f80dd98dc 100644 --- a/src/wimax/model/ss-net-device.cc +++ b/src/wimax/model/ss-net-device.cc @@ -745,7 +745,7 @@ SubscriberStationNetDevice::Enqueue(Ptr packet, "Error while enqueuing packet: incorrect header type"); GrantManagementSubheader grantMgmntSubhdr; - grantMgmntSubhdr.SetPm(true); + grantMgmntSubhdr.SetPm(1); packet->AddHeader(grantMgmntSubhdr); } } From 7ea750447641255cbcad3e1d86fa162610c4bdaa Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Tue, 26 Sep 2023 16:59:57 +0900 Subject: [PATCH 011/379] lr-wpan: Fix PHY BUSY_RX -> RX_ON --- RELEASE_NOTES.md | 2 + src/lr-wpan/model/lr-wpan-phy.cc | 113 ++++++++++++++++++++----------- src/lr-wpan/model/lr-wpan-phy.h | 43 +++++++++--- 3 files changed, 109 insertions(+), 49 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 02f488230..4748254c7 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,8 @@ Release 3-dev ### Bugs fixed +- (lr-wpan) !1673 - Fixes PHY BUSY_RX -> RX_ON operation + Release 3.40 ------------ diff --git a/src/lr-wpan/model/lr-wpan-phy.cc b/src/lr-wpan/model/lr-wpan-phy.cc index f0f9ad606..ac8708878 100644 --- a/src/lr-wpan/model/lr-wpan-phy.cc +++ b/src/lr-wpan/model/lr-wpan-phy.cc @@ -87,6 +87,61 @@ const LrWpanPhyPpduHeaderSymbolNumber ppduHeaderSymbolNumbers[IEEE_802_15_4_INVA {8.0, 2.0, 2.0}, }; +std::ostream& +operator<<(std::ostream& os, const LrWpanPhyEnumeration& state) +{ + switch (state) + { + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_BUSY: + os << "BUSY"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_BUSY_RX: + os << "BUSY_RX"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_BUSY_TX: + os << "BUSY_TX"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_FORCE_TRX_OFF: + os << "FORCE_TRX_OFF"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_IDLE: + os << "IDLE"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_INVALID_PARAMETER: + os << "INVALID_PARAMETER"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_RX_ON: + os << "RX_ON"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_SUCCESS: + os << "SUCCESS"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_TRX_OFF: + os << "TRX_OFF"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_TX_ON: + os << "TX_ON"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_UNSUPPORTED_ATTRIBUTE: + os << "UNSUPPORTED"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_READ_ONLY: + os << "READ_ONLY"; + break; + case LrWpanPhyEnumeration::IEEE_802_15_4_PHY_UNSPECIFIED: + os << "UNSPECIFIED"; + break; + } + return os; +}; + +std::ostream& +operator<<(std::ostream& os, const TracedValue& state) +{ + LrWpanPhyEnumeration s = state; + return os << s; +}; + TypeId LrWpanPhy::GetTypeId() { @@ -241,14 +296,12 @@ LrWpanPhy::DoDispose() Ptr LrWpanPhy::GetDevice() const { - NS_LOG_FUNCTION(this); return m_device; } Ptr LrWpanPhy::GetMobility() const { - NS_LOG_FUNCTION(this); return m_mobility; } @@ -297,7 +350,6 @@ LrWpanPhy::GetRxSpectrumModel() const Ptr LrWpanPhy::GetAntenna() const { - NS_LOG_FUNCTION(this); return m_antenna; } @@ -548,6 +600,10 @@ LrWpanPhy::EndRx(Ptr par) if (!m_currentRxPacket.second) { + m_currentRxPacket = std::make_pair(nullptr, true); + ChangeTrxState(IEEE_802_15_4_PHY_RX_ON); + NS_LOG_DEBUG("Packet successfully received"); + // The packet was successfully received, push it up the stack. if (!m_pdDataIndicationCallback.IsNull()) { @@ -556,42 +612,21 @@ LrWpanPhy::EndRx(Ptr par) } else { - // The packet was destroyed, drop it. + // The packet was destroyed due to interference, post-rx corruption or + // cancelled, therefore drop it. m_phyRxDropTrace(currentPacket); - } - Ptr none = nullptr; - m_currentRxPacket = std::make_pair(none, true); + m_currentRxPacket = std::make_pair(nullptr, true); - if (!m_isRxCanceled) - { - // We may be waiting to apply a pending state change. - if (m_trxStatePending != IEEE_802_15_4_PHY_IDLE) - { - // Only change the state immediately, if the transceiver is not already - // switching the state. - if (!m_setTRXState.IsRunning()) - { - NS_LOG_LOGIC("Apply pending state change to " << m_trxStatePending); - ChangeTrxState(m_trxStatePending); - m_trxStatePending = IEEE_802_15_4_PHY_IDLE; - if (!m_plmeSetTRXStateConfirmCallback.IsNull()) - { - m_plmeSetTRXStateConfirmCallback(IEEE_802_15_4_PHY_SUCCESS); - } - } - } - else + if (!m_isRxCanceled) { ChangeTrxState(IEEE_802_15_4_PHY_RX_ON); } - } - else - { - // A TX event was forced during the reception of the frame. - // There is no need to change the PHY state after handling the signal, - // because the Forced TX already changed the PHY state. - // Return flag to default state - m_isRxCanceled = false; + else + { + // The state of The PHY was already changed when the packet was canceled + // due to a forced operation. + m_isRxCanceled = false; + } } } } @@ -776,6 +811,7 @@ LrWpanPhy::PlmeSetTRXStateRequest(LrWpanPhyEnumeration state) (state != IEEE_802_15_4_PHY_FORCE_TRX_OFF) && (state != IEEE_802_15_4_PHY_TX_ON)); NS_LOG_LOGIC("Trying to set m_trxState from " << m_trxState << " to " << state); + // this method always overrides previous state setting attempts if (!m_setTRXState.IsExpired()) { @@ -1321,6 +1357,7 @@ void LrWpanPhy::ChangeTrxState(LrWpanPhyEnumeration newState) { NS_LOG_LOGIC(this << " state: " << m_trxState << " -> " << newState); + m_trxStateLogger(Simulator::Now(), m_trxState, newState); m_trxState = newState; } @@ -1560,8 +1597,6 @@ LrWpanPhy::GetCurrentChannelNum() const double LrWpanPhy::GetDataOrSymbolRate(bool isData) { - NS_LOG_FUNCTION(this << isData); - double rate = 0.0; NS_ASSERT(m_phyOption < IEEE_802_15_4_INVALID_PHY_OPTION); @@ -1691,10 +1726,8 @@ LrWpanPhy::SetPhyOption(LrWpanPhyOption phyOption) SetRxSensitivity(-106.58); m_rxLastUpdate = Seconds(0); - Ptr none_packet = nullptr; - Ptr none_params = nullptr; - m_currentRxPacket = std::make_pair(none_params, true); - m_currentTxPacket = std::make_pair(none_packet, true); + m_currentRxPacket = std::make_pair(nullptr, true); + m_currentTxPacket = std::make_pair(nullptr, true); m_errorModel = nullptr; } diff --git a/src/lr-wpan/model/lr-wpan-phy.h b/src/lr-wpan/model/lr-wpan-phy.h index 995c715c3..5cfbc3913 100644 --- a/src/lr-wpan/model/lr-wpan-phy.h +++ b/src/lr-wpan/model/lr-wpan-phy.h @@ -28,6 +28,8 @@ #include #include +#include + namespace ns3 { @@ -122,6 +124,24 @@ enum LrWpanPhyEnumeration IEEE_802_15_4_PHY_UNSPECIFIED = 0xc // all cases not covered by ieee802.15.4 }; +/** + * Overloaded operator to print the value of a LrWpanPhyEnumeration. + * + * \param os The output stream + * \param state The text value of the PHY state + * \return The output stream with text value of the PHY state + */ +std::ostream& operator<<(std::ostream& os, const LrWpanPhyEnumeration& state); + +/** + * Overloaded operator to print the value of a TracedValue. + * + * \param os The output stream + * \param state The text value of the PHY state + * \return The output stream with text value of the PHY state + */ +std::ostream& operator<<(std::ostream& os, const TracedValue& state); + namespace TracedValueCallback { /** @@ -704,7 +724,10 @@ class LrWpanPhy : public SpectrumPhy /** * The trace source fired when a packet ends the reception process from - * the medium. Second quantity is received SINR. + * the medium. In essence, the notional event of receiving all the energy + * of a signal is traced. The received completed signal might represent + * a complete packet or a packet that is later on dropped because of interference, + * cancellation or post-rx corruption. Second quantity is the received SINR (LQI). * * \see class CallBackTraceSource */ @@ -712,6 +735,8 @@ class LrWpanPhy : public SpectrumPhy /** * The trace source fired when the phy layer drops a packet it has received. + * (Destruction of a packet due to interference, post-rx corruption or + * cancellation of packet rx) * * \see class CallBackTraceSource */ @@ -894,18 +919,18 @@ class LrWpanPhy : public SpectrumPhy Time m_rxLastUpdate; /** - * Statusinformation of the currently received packet. The first parameter - * contains the frame, as well the signal power of the frame. The second - * parameter is set to false, if the frame is either invalid or destroyed - * due to interference. + * Status information of the currently received packet. The first parameter + * contains the frame, as well the signal power of the frame. If the second + * parameter is set to true, the frame is either invalid, destroyed + * due to interference or cancelled. */ std::pair, bool> m_currentRxPacket; /** - * Statusinformation of the currently transmitted packet. The first parameter - * contains the frame. The second parameter is set to false, if the frame not - * completely transmitted, in the event of a force transceiver switch, for - * example. + * Status information of the currently transmitted packet. The first parameter + * contains the frame. If the second parameter is set to true, the frame has not + * been completely transmitted (in the event of a force transceiver switch, for + * example). */ PacketAndStatus m_currentTxPacket; From 738729e0ab11ec8d9e8f8916ef75ba3852f85717 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Tue, 3 Oct 2023 15:27:43 +0100 Subject: [PATCH 012/379] check-style: Fix documentation and add usage example for modified files --- doc/contributing/source/coding-style.rst | 7 +++++-- utils/check-style-clang-format.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/contributing/source/coding-style.rst b/doc/contributing/source/coding-style.rst index 15941d45f..b82631b93 100644 --- a/doc/contributing/source/coding-style.rst +++ b/doc/contributing/source/coding-style.rst @@ -114,8 +114,8 @@ check-style-clang-format.py To facilitate checking and fixing source code files according to the |ns3| coding style, |ns3| maintains the ``check-style-clang-format.py`` Python script (located in ``utils/``). This script is a wrapper to clang-format and provides useful options to check and fix -source code files. Additionally, it checks and fixes trailing whitespace and tabs in text -files. +source code files. Additionally, it performs other manual checks and fixes in text files +(described below). We recommend running this script over your newly introduced C++ files prior to submission as a Merge Request. @@ -160,6 +160,9 @@ For quick-reference, the most used commands are listed below: # Specific directory or file /path/to/utils/check-style-clang-format.py --fix absolute_or_relative/path/to/directory_or_file + # Modified files + git diff --name-only | xargs ./utils/check-style-clang-format.py --fix + Clang-tidy ********** diff --git a/utils/check-style-clang-format.py b/utils/check-style-clang-format.py index e4b118e0f..0d0c65f91 100755 --- a/utils/check-style-clang-format.py +++ b/utils/check-style-clang-format.py @@ -18,7 +18,7 @@ # Author: Eduardo Nuno Almeida [INESC TEC and FEUP, Portugal] """ -Check and apply the ns-3 coding style to all files in the PATH argument. +Check and apply the ns-3 coding style recursively to all files in the PATH arguments. The coding style is defined with the clang-format tool, whose definitions are in the ".clang-format" file. This script performs the following checks / fixes: @@ -30,8 +30,8 @@ the ".clang-format" file. This script performs the following checks / fixes: This script can be applied to all text files in a given path or to individual files. NOTE: The formatting check requires clang-format (version >= 14) to be found on the path. -Trimming of trailing whitespace and conversion of tabs to spaces (via the "--no-formatting" -option) do not depend on clang-format. +The remaining checks do not depend on clang-format and can be executed by disabling clang-format +checking with the "--no-formatting" option. """ import argparse @@ -680,7 +680,7 @@ def check_tabs_file(filename: str, if __name__ == '__main__': parser = argparse.ArgumentParser( - description='Check and apply the ns-3 coding style to all files in a given PATH. ' + description='Check and apply the ns-3 coding style recursively to all files in the given PATHs. ' 'The script checks the formatting of the file with clang-format. ' 'Additionally, it checks #include headers from the same module with the "ns3/" prefix, ' 'the presence of trailing whitespace and tabs. ' From 706f6771a9e3af8a9b6794d18ed52e1ef06eb8a8 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Fri, 29 Sep 2023 17:56:28 +0100 Subject: [PATCH 013/379] check-style: Refactor manual checks to reduce duplicate code --- utils/check-style-clang-format.py | 345 ++++++++++++++---------------- 1 file changed, 165 insertions(+), 180 deletions(-) diff --git a/utils/check-style-clang-format.py b/utils/check-style-clang-format.py index 0d0c65f91..62db020f8 100755 --- a/utils/check-style-clang-format.py +++ b/utils/check-style-clang-format.py @@ -304,22 +304,24 @@ def check_style_clang_format(paths: List[str], check_tabs_successful = True if enable_check_include_prefixes: - check_include_prefixes_successful = check_style_file( - files_to_check_include_prefixes, - check_include_prefixes_file, + check_include_prefixes_successful = check_style_files( '#include headers from the same module with the "ns3/" prefix', + check_manually_file, + files_to_check_include_prefixes, fix, verbose, n_jobs, + respect_clang_format_guards=True, + check_style_line_function=check_include_prefixes_line, ) print('') if enable_check_formatting: - check_formatting_successful = check_style_file( - files_to_check_formatting, - check_formatting_file, + check_formatting_successful = check_style_files( 'bad code formatting', + check_formatting_file, + files_to_check_formatting, fix, verbose, n_jobs, @@ -329,25 +331,29 @@ def check_style_clang_format(paths: List[str], print('') if enable_check_whitespace: - check_whitespace_successful = check_style_file( - files_to_check_whitespace, - check_trailing_whitespace_file, + check_whitespace_successful = check_style_files( 'trailing whitespace', + check_manually_file, + files_to_check_whitespace, fix, verbose, n_jobs, + respect_clang_format_guards=False, + check_style_line_function=check_whitespace_line, ) print('') if enable_check_tabs: - check_tabs_successful = check_style_file( - files_to_check_tabs, - check_tabs_file, + check_tabs_successful = check_style_files( 'tabs', + check_manually_file, + files_to_check_tabs, fix, verbose, n_jobs, + respect_clang_format_guards=True, + check_style_line_function=check_tabs_line, ) return all([ @@ -358,20 +364,20 @@ def check_style_clang_format(paths: List[str], ]) -def check_style_file(filenames: List[str], - check_style_file_function: Callable, - style_check_str: str, - fix: bool, - verbose: bool, - n_jobs: int, - **kwargs, - ) -> bool: +def check_style_files(style_check_str: str, + check_style_file_function: Callable[..., Tuple[str, bool, List[str]]], + filenames: List[str], + fix: bool, + verbose: bool, + n_jobs: int, + **kwargs, + ) -> bool: """ Check / fix style of a list of files. - @param filename Name of the file to be checked. - @param check_style_file_function Function used to check the file. @param style_check_str Description of the check to be performed. + @param check_style_file_function Function used to check the file. + @param filename Name of the file to be checked. @param fix Whether to fix (True) or just check (False) the file (True). @param verbose Show the lines that are not compliant with the style. @param n_jobs Number of parallel jobs. @@ -425,81 +431,6 @@ def check_style_file(filenames: List[str], ########################################################### # CHECK STYLE FUNCTIONS ########################################################### -def check_include_prefixes_file(filename: str, - fix: bool, - verbose: bool, - ) -> Tuple[str, bool, List[str]]: - """ - Check / fix #include headers from the same module with the "ns3/" prefix in a file. - - @param filename Name of the file to be checked. - @param fix Whether to fix (True) or just check (False) the style of the file (True). - @param verbose Show the lines that are not compliant with the style. - @return Tuple [Filename, - Whether the file is compliant with the style (before the check), - Verbose information]. - """ - - is_file_compliant = True - clang_format_enabled = True - - verbose_infos: List[str] = [] - - with open(filename, 'r', encoding='utf-8') as f: - file_lines = f.readlines() - - for (i, line) in enumerate(file_lines): - - # Check clang-format guards - line_stripped = line.strip() - - if line_stripped == CLANG_FORMAT_GUARD_ON: - clang_format_enabled = True - elif line_stripped == CLANG_FORMAT_GUARD_OFF: - clang_format_enabled = False - - if (not clang_format_enabled and - line_stripped not in (CLANG_FORMAT_GUARD_ON, CLANG_FORMAT_GUARD_OFF)): - continue - - # Check if the line is an #include and extract its header file - header_file = re.findall(r'^#include ["<]ns3/(.*\.h)[">]', line_stripped) - - if not header_file: - continue - - # Check if the header file belongs to the same module and remove the "ns3/" prefix - header_file = header_file[0] - parent_path = os.path.split(filename)[0] - - if not os.path.exists(os.path.join(parent_path, header_file)): - continue - - is_file_compliant = False - file_lines[i] = line_stripped.replace( - f'ns3/{header_file}', header_file).replace('<', '"').replace('>', '"') + '\n' - - if verbose: - header_index = len('#include "') - - verbose_infos.extend([ - f'{filename}:{i + 1}:{header_index + 1}: error: #include headers from the same module with the "ns3/" prefix detected', - f' {line_stripped}', - f' {"":{header_index}}^', - ]) - - # Optimization: If running in non-verbose check mode, only one error is needed to check that the file is not compliant - if not fix and not verbose: - break - - # Update file with the fixed lines - if fix and not is_file_compliant: - with open(filename, 'w', encoding='utf-8') as f: - f.writelines(file_lines) - - return (filename, is_file_compliant, verbose_infos) - - def check_formatting_file(filename: str, fix: bool, verbose: bool, @@ -557,16 +488,20 @@ def check_formatting_file(filename: str, return (filename, is_file_compliant, verbose_infos) -def check_trailing_whitespace_file(filename: str, - fix: bool, - verbose: bool, - ) -> Tuple[str, bool, List[str]]: +def check_manually_file(filename: str, + fix: bool, + verbose: bool, + respect_clang_format_guards: bool, + check_style_line_function: Callable[[str, str, int], Tuple[bool, str, List[str]]], + ) -> Tuple[str, bool, List[str]]: """ - Check / fix trailing whitespace in a file. + Check / fix a file manually using a function to check / fix each line. @param filename Name of the file to be checked. @param fix Whether to fix (True) or just check (False) the style of the file (True). @param verbose Show the lines that are not compliant with the style. + @param respect_clang_format_guards Whether to respect clang-format guards. + @param check_style_line_function Function used to check each line. @return Tuple [Filename, Whether the file is compliant with the style (before the check), Verbose information]. @@ -574,97 +509,37 @@ def check_trailing_whitespace_file(filename: str, is_file_compliant = True verbose_infos: List[str] = [] - - with open(filename, 'r', encoding='utf-8') as f: - file_lines = f.readlines() - - # Check if there are trailing whitespace and fix them - for (i, line) in enumerate(file_lines): - line_fixed = line.rstrip() + '\n' - - if line_fixed == line: - continue - - is_file_compliant = False - file_lines[i] = line_fixed - - if verbose: - line_fixed_stripped_expanded = line_fixed.rstrip().expandtabs(TAB_SIZE) - - verbose_infos.extend([ - f'{filename}:{i + 1}:{len(line_fixed_stripped_expanded) + 1}: error: Trailing whitespace detected', - f' {line_fixed_stripped_expanded}', - f' {"":{len(line_fixed_stripped_expanded)}}^', - ]) - - # Optimization: If running in non-verbose check mode, only one error is needed to check that the file is not compliant - if not fix and not verbose: - break - - # Update file with the fixed lines - if fix and not is_file_compliant: - with open(filename, 'w', encoding='utf-8') as f: - f.writelines(file_lines) - - return (filename, is_file_compliant, verbose_infos) - - -def check_tabs_file(filename: str, - fix: bool, - verbose: bool, - ) -> Tuple[str, bool, List[str]]: - """ - Check / fix tabs in a file. - - @param filename Name of the file to be checked. - @param fix Whether to fix (True) or just check (False) the style of the file (True). - @param verbose Show the lines that are not compliant with the style. - @return Tuple [Filename, - Whether the file is compliant with the style (before the check), - Verbose information]. - """ - - is_file_compliant = True clang_format_enabled = True - verbose_infos: List[str] = [] - with open(filename, 'r', encoding='utf-8') as f: file_lines = f.readlines() for (i, line) in enumerate(file_lines): # Check clang-format guards - line_stripped = line.strip() + if respect_clang_format_guards: + line_stripped = line.strip() - if line_stripped == CLANG_FORMAT_GUARD_ON: - clang_format_enabled = True - elif line_stripped == CLANG_FORMAT_GUARD_OFF: - clang_format_enabled = False + if line_stripped == CLANG_FORMAT_GUARD_ON: + clang_format_enabled = True + elif line_stripped == CLANG_FORMAT_GUARD_OFF: + clang_format_enabled = False - if (not clang_format_enabled and - line_stripped not in (CLANG_FORMAT_GUARD_ON, CLANG_FORMAT_GUARD_OFF)): - continue + if (not clang_format_enabled and + line_stripped not in (CLANG_FORMAT_GUARD_ON, CLANG_FORMAT_GUARD_OFF)): + continue - # Check if there are tabs and fix them - tab_index = line.find('\t') + # Check if the line is compliant with the style and fix it + (is_line_compliant, line_fixed, line_verbose_infos) = check_style_line_function(line, filename, i) - if tab_index == -1: - continue + if not is_line_compliant: + is_file_compliant = False + file_lines[i] = line_fixed + verbose_infos.extend(line_verbose_infos) - is_file_compliant = False - file_lines[i] = line.expandtabs(TAB_SIZE) - - if verbose: - verbose_infos.extend([ - f'{filename}:{i + 1}:{tab_index + 1}: error: Tab detected', - f' {line.rstrip()}', - f' {"":{tab_index}}^', - ]) - - # Optimization: If running in non-verbose check mode, only one error is needed to check that the file is not compliant - if not fix and not verbose: - break + # Optimization: If running in non-verbose check mode, only one error is needed to check that the file is not compliant + if not fix and not verbose: + break # Update file with the fixed lines if fix and not is_file_compliant: @@ -674,6 +549,116 @@ def check_tabs_file(filename: str, return (filename, is_file_compliant, verbose_infos) +def check_include_prefixes_line(line: str, + filename: str, + line_number: int, + ) -> Tuple[bool, str, List[str]]: + """ + Check / fix #include headers from the same module with the "ns3/" prefix in a line. + + @param line The line to check. + @param filename Name of the file to be checked. + @param line_number The number of the line checked. + @return Tuple [Whether the line is compliant with the style (before the check), + Fixed line, + Verbose information]. + """ + + is_line_compliant = True + line_fixed = line + verbose_infos: List[str] = [] + + # Check if the line is an #include and extract its header file + line_stripped = line.strip() + header_file = re.findall(r'^#include ["<]ns3/(.*\.h)[">]', line_stripped) + + if header_file: + # Check if the header file belongs to the same module and remove the "ns3/" prefix + header_file = header_file[0] + parent_path = os.path.split(filename)[0] + + if os.path.exists(os.path.join(parent_path, header_file)): + is_line_compliant = False + line_fixed = line_stripped.replace( + f'ns3/{header_file}', header_file).replace('<', '"').replace('>', '"') + '\n' + + header_index = len('#include "') + + verbose_infos.extend([ + f'{filename}:{line_number + 1}:{header_index + 1}: error: #include headers from the same module with the "ns3/" prefix detected', + f' {line_stripped}', + f' {"":{header_index}}^', + ]) + + return (is_line_compliant, line_fixed, verbose_infos) + + +def check_whitespace_line(line: str, + filename: str, + line_number: int, + ) -> Tuple[bool, str, List[str]]: + """ + Check / fix whitespace in a line. + + @param line The line to check. + @param filename Name of the file to be checked. + @param line_number The number of the line checked. + @return Tuple [Whether the line is compliant with the style (before the check), + Fixed line, + Verbose information]. + """ + + is_line_compliant = True + line_fixed = line.rstrip() + '\n' + verbose_infos: List[str] = [] + + if line_fixed != line: + is_line_compliant = False + line_fixed_stripped_expanded = line_fixed.rstrip().expandtabs(TAB_SIZE) + + verbose_infos = [ + f'{filename}:{line_number + 1}:{len(line_fixed_stripped_expanded) + 1}: error: Trailing whitespace detected', + f' {line_fixed_stripped_expanded}', + f' {"":{len(line_fixed_stripped_expanded)}}^', + ] + + return (is_line_compliant, line_fixed, verbose_infos) + + +def check_tabs_line(line: str, + filename: str, + line_number: int, + ) -> Tuple[bool, str, List[str]]: + """ + Check / fix tabs in a line. + + @param line The line to check. + @param filename Name of the file to be checked. + @param line_number The number of the line checked. + @return Tuple [Whether the line is compliant with the style (before the check), + Fixed line, + Verbose information]. + """ + + is_line_compliant = True + line_fixed = line + verbose_infos: List[str] = [] + + tab_index = line.find('\t') + + if tab_index != -1: + is_line_compliant = False + line_fixed = line.expandtabs(TAB_SIZE) + + verbose_infos = [ + f'{filename}:{line_number + 1}:{tab_index + 1}: error: Tab detected', + f' {line.rstrip()}', + f' {"":{tab_index}}^', + ] + + return (is_line_compliant, line_fixed, verbose_infos) + + ########################################################### # MAIN ########################################################### From 8268dd5c34a78781e1b5a7232c1ce1a437b0322f Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Tue, 3 Oct 2023 21:01:52 +0100 Subject: [PATCH 014/379] check-style: Add .git/ and remove .vscode/ from list of directories to skip --- utils/check-style-clang-format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/check-style-clang-format.py b/utils/check-style-clang-format.py index 62db020f8..511aa2696 100755 --- a/utils/check-style-clang-format.py +++ b/utils/check-style-clang-format.py @@ -59,7 +59,7 @@ CLANG_FORMAT_GUARD_OFF = '// clang-format off' DIRECTORIES_TO_SKIP = [ '__pycache__', - '.vscode', + '.git', 'bindings', 'build', 'cmake-cache', From c77aba9cbcd5640a9d0eb79bdd3970616d96590e Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 16 Sep 2023 23:27:01 -0300 Subject: [PATCH 015/379] mpi: initialize MPI_Request with MPI_REQUEST_NULL Fixes compatibility issue with Mpich --- src/mpi/model/granted-time-window-mpi-interface.cc | 2 +- src/mpi/model/null-message-mpi-interface.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mpi/model/granted-time-window-mpi-interface.cc b/src/mpi/model/granted-time-window-mpi-interface.cc index 4af05eeb7..bc79c31d1 100644 --- a/src/mpi/model/granted-time-window-mpi-interface.cc +++ b/src/mpi/model/granted-time-window-mpi-interface.cc @@ -52,7 +52,7 @@ NS_OBJECT_ENSURE_REGISTERED(GrantedTimeWindowMpiInterface); SentBuffer::SentBuffer() { m_buffer = nullptr; - m_request = nullptr; + m_request = MPI_REQUEST_NULL; } SentBuffer::~SentBuffer() diff --git a/src/mpi/model/null-message-mpi-interface.cc b/src/mpi/model/null-message-mpi-interface.cc index 7341d8800..ba990a135 100644 --- a/src/mpi/model/null-message-mpi-interface.cc +++ b/src/mpi/model/null-message-mpi-interface.cc @@ -97,7 +97,7 @@ const uint32_t NULL_MESSAGE_MAX_MPI_MSG_SIZE = 2000; NullMessageSentBuffer::NullMessageSentBuffer() { m_buffer = nullptr; - m_request = nullptr; + m_request = MPI_REQUEST_NULL; } NullMessageSentBuffer::~NullMessageSentBuffer() From 933e0587f653ed4a84842c6bb752f7e42de1b9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Thu, 2 Feb 2023 18:02:08 +0100 Subject: [PATCH 016/379] util: Don't use types as variable names + use early return --- utils.py | 86 +++++++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/utils.py b/utils.py index a70aaae29..c4f5d20d0 100644 --- a/utils.py +++ b/utils.py @@ -16,35 +16,35 @@ def get_list_from_file(file_path, list_name): ''' - list = [] - # Read in the file if it exists. - if os.path.exists(file_path): - with open(file_path, "r", encoding="utf-8") as file_in: + if not os.path.exists(file_path): + return [] - # Look for the list. - list_string = "" - parsing_multiline_list = False - for line in file_in: + with open(file_path, "r", encoding="utf-8") as file_in: - # Remove any comments. - if '#' in line: - (line, comment) = line.split('#', 1) + # Look for the list. + list_string = "" + parsing_multiline_list = False + for line in file_in: - # Parse the line. - if list_name in line or parsing_multiline_list: - list_string += line + # Remove any comments. + if '#' in line: + (line, comment) = line.split('#', 1) - # Handle multiline lists. - if ']' not in list_string: - parsing_multiline_list = True - else: - # Evaluate the list once its end is reached. - # Make the split function only split it once. - list = eval(list_string.split('=', 1)[1].strip()) - break + # Parse the line. + if list_name in line or parsing_multiline_list: + list_string += line - return list + # Handle multiline lists. + if ']' not in list_string: + parsing_multiline_list = True + else: + # Evaluate the list once its end is reached. + # Make the split function only split it once. + return eval(list_string.split('=', 1)[1].strip()) + + # List name was not found + return [] def get_bool_from_file(file_path, bool_name, value_if_missing): @@ -57,30 +57,26 @@ def get_bool_from_file(file_path, bool_name, value_if_missing): ''' # Read in the file if it exists. - if os.path.exists(file_path): - with open(file_path, "r", encoding="utf-8") as file_in: - - # Look for the boolean variable. - bool_found = False - for line in file_in: - - # Remove any comments. - if '#' in line: - (line, comment) = line.split('#', 1) - - # Parse the line. - if bool_name in line: - # Evaluate the variable's line once it is found. Make - # the split function only split it once. - bool = eval(line.split('=', 1)[1].strip()) - bool_found = True - break - - if bool_found: - return bool - else: + if not os.path.exists(file_path): return value_if_missing + with open(file_path, "r", encoding="utf-8") as file_in: + # Look for the boolean variable. + for line in file_in: + + # Remove any comments. + if '#' in line: + (line, comment) = line.split('#', 1) + + # Parse the line. + if bool_name in line: + # Evaluate the variable's line once it is found. Make + # the split function only split it once. + return eval(line.split('=', 1)[1].strip()) + + # Boolean variable was not found + return value_if_missing + # Reads the NS-3 configuration file and returns a list of enabled modules. # From f426a0749a2962f359958672679d8be0b3dafbed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 1 Feb 2023 14:51:31 +0100 Subject: [PATCH 017/379] test: use early return --- test.py | 159 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/test.py b/test.py index 083610081..9ec512d5d 100755 --- a/test.py +++ b/test.py @@ -137,94 +137,95 @@ def parse_examples_to_run_file( python_tests): # Look for the examples-to-run file exists. - if os.path.exists(examples_to_run_path): + if not os.path.exists(examples_to_run_path): + return - # Each tuple in the C++ list of examples to run contains - # - # (example_name, do_run, do_valgrind_run) - # - # where example_name is the executable to be run, do_run is a - # condition under which to run the example, and do_valgrind_run is - # a condition under which to run the example under valgrind. This - # is needed because NSC causes illegal instruction crashes with - # some tests when they are run under valgrind. - # - # Note that the two conditions are Python statements that - # can depend on ns3 configuration variables. For example, - # when NSC was in the codebase, we could write: - # - # ("tcp-nsc-lfn", "NSC_ENABLED == True", "NSC_ENABLED == False"), - # - cpp_examples = get_list_from_file(examples_to_run_path, "cpp_examples") - for example_name, do_run, do_valgrind_run in cpp_examples: + # Each tuple in the C++ list of examples to run contains + # + # (example_name, do_run, do_valgrind_run) + # + # where example_name is the executable to be run, do_run is a + # condition under which to run the example, and do_valgrind_run is + # a condition under which to run the example under valgrind. This + # is needed because NSC causes illegal instruction crashes with + # some tests when they are run under valgrind. + # + # Note that the two conditions are Python statements that + # can depend on ns3 configuration variables. For example, + # when NSC was in the codebase, we could write: + # + # ("tcp-nsc-lfn", "NSC_ENABLED == True", "NSC_ENABLED == False"), + # + cpp_examples = get_list_from_file(examples_to_run_path, "cpp_examples") + for example_name, do_run, do_valgrind_run in cpp_examples: - # Separate the example name from its arguments. - example_name_original = example_name - example_name_parts = example_name.split(' ', 1) - if len(example_name_parts) == 1: - example_name = example_name_parts[0] - example_arguments = "" - else: - example_name = example_name_parts[0] - example_arguments = example_name_parts[1] + # Separate the example name from its arguments. + example_name_original = example_name + example_name_parts = example_name.split(' ', 1) + if len(example_name_parts) == 1: + example_name = example_name_parts[0] + example_arguments = "" + else: + example_name = example_name_parts[0] + example_arguments = example_name_parts[1] - # Add the proper prefix and suffix to the example name to - # match what is done in the CMakeLists.txt file. - example_path = "%s%s-%s%s" % (APPNAME, VERSION, example_name, BUILD_PROFILE_SUFFIX) + # Add the proper prefix and suffix to the example name to + # match what is done in the CMakeLists.txt file. + example_path = "%s%s-%s%s" % (APPNAME, VERSION, example_name, BUILD_PROFILE_SUFFIX) - # Set the full path for the example. - example_path = os.path.join(cpp_executable_dir, example_path) - example_path += '.exe' if sys.platform == 'win32' else '' - example_name = os.path.join( - os.path.relpath(cpp_executable_dir, NS3_BUILDDIR), - example_name) - # Add all of the C++ examples that were built, i.e. found - # in the directory, to the list of C++ examples to run. - if os.path.exists(example_path): - # Add any arguments to the path. - if len(example_name_parts) != 1: - example_path = "%s %s" % (example_path, example_arguments) - example_name = "%s %s" % (example_name, example_arguments) + # Set the full path for the example. + example_path = os.path.join(cpp_executable_dir, example_path) + example_path += '.exe' if sys.platform == 'win32' else '' + example_name = os.path.join( + os.path.relpath(cpp_executable_dir, NS3_BUILDDIR), + example_name) + # Add all of the C++ examples that were built, i.e. found + # in the directory, to the list of C++ examples to run. + if os.path.exists(example_path): + # Add any arguments to the path. + if len(example_name_parts) != 1: + example_path = "%s %s" % (example_path, example_arguments) + example_name = "%s %s" % (example_name, example_arguments) - # Add this example. - example_tests.append((example_name, example_path, do_run, do_valgrind_run)) - example_names_original.append(example_name_original) + # Add this example. + example_tests.append((example_name, example_path, do_run, do_valgrind_run)) + example_names_original.append(example_name_original) - # Each tuple in the Python list of examples to run contains - # - # (example_name, do_run) - # - # where example_name is the Python script to be run and - # do_run is a condition under which to run the example. - # - # Note that the condition is a Python statement that can - # depend on ns3 configuration variables. For example, - # - # ("realtime-udp-echo.py", "ENABLE_REAL_TIME == True"), - # - python_examples = get_list_from_file(examples_to_run_path, "python_examples") - for example_name, do_run in python_examples: - # Separate the example name from its arguments. - example_name_parts = example_name.split(' ', 1) - if len(example_name_parts) == 1: - example_name = example_name_parts[0] - example_arguments = "" - else: - example_name = example_name_parts[0] - example_arguments = example_name_parts[1] + # Each tuple in the Python list of examples to run contains + # + # (example_name, do_run) + # + # where example_name is the Python script to be run and + # do_run is a condition under which to run the example. + # + # Note that the condition is a Python statement that can + # depend on ns3 configuration variables. For example, + # + # ("realtime-udp-echo.py", "ENABLE_REAL_TIME == True"), + # + python_examples = get_list_from_file(examples_to_run_path, "python_examples") + for example_name, do_run in python_examples: + # Separate the example name from its arguments. + example_name_parts = example_name.split(' ', 1) + if len(example_name_parts) == 1: + example_name = example_name_parts[0] + example_arguments = "" + else: + example_name = example_name_parts[0] + example_arguments = example_name_parts[1] - # Set the full path for the example. - example_path = os.path.join(python_script_dir, example_name) + # Set the full path for the example. + example_path = os.path.join(python_script_dir, example_name) - # Add all of the Python examples that were found to the - # list of Python examples to run. - if os.path.exists(example_path): - # Add any arguments to the path. - if len(example_name_parts) != 1: - example_path = "%s %s" % (example_path, example_arguments) + # Add all of the Python examples that were found to the + # list of Python examples to run. + if os.path.exists(example_path): + # Add any arguments to the path. + if len(example_name_parts) != 1: + example_path = "%s %s" % (example_path, example_arguments) - # Add this example. - python_tests.append((example_path, do_run)) + # Add this example. + python_tests.append((example_path, do_run)) # # The test suites are going to want to output status. They are running From 00604f18e1c20f61b54b94c18b200ec584224230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Tue, 4 Apr 2023 10:12:43 +0200 Subject: [PATCH 018/379] test: Remove Python2 fallback --- test.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test.py b/test.py index 9ec512d5d..cc853ac8c 100755 --- a/test.py +++ b/test.py @@ -18,6 +18,7 @@ import argparse import fnmatch import os +import queue import shutil import signal import subprocess @@ -45,10 +46,6 @@ class color_dict(object): return get_color(a) colors = color_dict() -try: - import queue -except ImportError: - import Queue as queue # # XXX This should really be part of a ns3 command to list the configuration # items relative to optional ns-3 pieces. From 6c87965ae208d7f6fa6ecd37e8d567ca16df159d Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Sun, 8 Oct 2023 14:33:24 +0100 Subject: [PATCH 019/379] scratch: Add nested-subdir/ to list of non-ignored dirs of .gitignore --- scratch/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/scratch/.gitignore b/scratch/.gitignore index 7d959a29d..64892bfaf 100644 --- a/scratch/.gitignore +++ b/scratch/.gitignore @@ -2,6 +2,7 @@ /* !.gitignore +!nested-subdir/ !subdir/ !scratch-simulator.cc !CMakeLists.txt From 7fbd63e085617a596e0e2a15b521d39d5b632a6b Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Mon, 2 Oct 2023 23:18:22 +0100 Subject: [PATCH 020/379] utils: Fix README Markdown linting issues --- utils/tests/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils/tests/README.md b/utils/tests/README.md index a478ca404..d2ac45c41 100644 --- a/utils/tests/README.md +++ b/utils/tests/README.md @@ -1,7 +1,6 @@ -./utils/tests directory -======================= +# ./utils/tests directory -## Table of Contents: +## Table of Contents 1) [What is](#what-is) 2) [Gitlab CI infrastructure](#gitlab-ci-infrastructure) @@ -13,7 +12,7 @@ In this directory, we store documents related to our testing infrastructure. ## Gitlab CI infrastructure -To know more about the Gitlab CI feature, please refer to https://about.gitlab.com/product/continuous-integration/. We use the services offered by Gitlab to test our software in multiple ways. If you are interested how to run these tests on your fork, please read below. +To know more about the Gitlab CI feature, please refer to . We use the services offered by Gitlab to test our software in multiple ways. If you are interested how to run these tests on your fork, please read below. Note: each user does have a limited amount of "minutes" (time used to run CI jobs). Minutes are limited, and if you run out of minutes you will not be able to run jobs until the next month - or until you pay for more minutes. @@ -79,7 +78,6 @@ Related to the timeout, our `gitlab-ci.yml` script also configures the job-level **Note**: The job-level timeout can exceed the [project-level](https://docs.gitlab.com/ee/ci/pipelines/settings.html#set-a-limit-for-how-long-jobs-can-run) timeout (default: 60 min), but can not exceed the Runner-specific timeout. - To summarize, if you are unsure about the commit you're about to merge into master, you can push it to a branch of your fork, then go to the Gitlab interface, click CI/CD, click Schedules, create a New From f392502d9dcd6503af31789c7abaae47a0a84d28 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Wed, 4 Oct 2023 09:44:15 +0200 Subject: [PATCH 021/379] csma: use const on transmitted packets --- src/csma/model/csma-channel.cc | 4 ++-- src/csma/model/csma-channel.h | 2 +- src/csma/model/csma-net-device.cc | 33 ++++++++++++++++--------------- src/csma/model/csma-net-device.h | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/csma/model/csma-channel.cc b/src/csma/model/csma-channel.cc index 2a0defc8c..af1e44a5b 100644 --- a/src/csma/model/csma-channel.cc +++ b/src/csma/model/csma-channel.cc @@ -191,7 +191,7 @@ CsmaChannel::TransmitStart(Ptr p, uint32_t srcId) } NS_LOG_LOGIC("switch to TRANSMITTING"); - m_currentPkt = p->Copy(); + m_currentPkt = p; m_currentSrc = srcId; m_state = TRANSMITTING; return true; @@ -234,7 +234,7 @@ CsmaChannel::TransmitEnd() m_delay, &CsmaNetDevice::Receive, it->devicePtr, - m_currentPkt->Copy(), + m_currentPkt, m_deviceList[m_currentSrc].devicePtr); } } diff --git a/src/csma/model/csma-channel.h b/src/csma/model/csma-channel.h index da4e948da..92263545e 100644 --- a/src/csma/model/csma-channel.h +++ b/src/csma/model/csma-channel.h @@ -325,7 +325,7 @@ class CsmaChannel : public Channel * packet to have been transmitted on the channel if the channel is * free.) */ - Ptr m_currentPkt; + Ptr m_currentPkt; /** * Device Id of the source that is currently transmitting on the diff --git a/src/csma/model/csma-net-device.cc b/src/csma/model/csma-net-device.cc index bb0b93894..fded5253f 100644 --- a/src/csma/model/csma-net-device.cc +++ b/src/csma/model/csma-net-device.cc @@ -695,7 +695,7 @@ CsmaNetDevice::SetReceiveErrorModel(Ptr em) } void -CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) +CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) { NS_LOG_FUNCTION(packet << senderDevice); NS_LOG_LOGIC("UID is " << packet->GetUid()); @@ -724,7 +724,9 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) return; } - if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt(packet)) + Ptr pktCopy = packet->Copy(); + + if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt(pktCopy)) { NS_LOG_LOGIC("Dropping pkt due to error model "); m_phyRxDropTrace(packet); @@ -735,16 +737,15 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) // Trace sinks will expect complete packets, not packets without some of the // headers. // - Ptr originalPacket = packet->Copy(); EthernetTrailer trailer; - packet->RemoveTrailer(trailer); + pktCopy->RemoveTrailer(trailer); if (Node::ChecksumEnabled()) { trailer.EnableFcs(true); } - bool crcGood = trailer.CheckFcs(packet); + bool crcGood = trailer.CheckFcs(pktCopy); if (!crcGood) { NS_LOG_INFO("CRC error on Packet " << packet); @@ -753,7 +754,7 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) } EthernetHeader header(false); - packet->RemoveHeader(header); + pktCopy->RemoveHeader(header); NS_LOG_LOGIC("Pkt source is " << header.GetSource()); NS_LOG_LOGIC("Pkt destination is " << header.GetDestination()); @@ -767,16 +768,16 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) // if (header.GetLengthType() <= 1500) { - NS_ASSERT(packet->GetSize() >= header.GetLengthType()); - uint32_t padlen = packet->GetSize() - header.GetLengthType(); + NS_ASSERT(pktCopy->GetSize() >= header.GetLengthType()); + uint32_t padlen = pktCopy->GetSize() - header.GetLengthType(); NS_ASSERT(padlen <= 46); if (padlen > 0) { - packet->RemoveAtEnd(padlen); + pktCopy->RemoveAtEnd(padlen); } LlcSnapHeader llc; - packet->RemoveHeader(llc); + pktCopy->RemoveHeader(llc); protocol = llc.GetType(); } else @@ -811,12 +812,12 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) // hook and pass a copy up to the promiscuous callback. Pass a copy to // make sure that nobody messes with our packet. // - m_promiscSnifferTrace(originalPacket); + m_promiscSnifferTrace(packet); if (!m_promiscRxCallback.IsNull()) { - m_macPromiscRxTrace(originalPacket); + m_macPromiscRxTrace(packet); m_promiscRxCallback(this, - packet, + pktCopy, protocol, header.GetSource(), header.GetDestination(), @@ -830,9 +831,9 @@ CsmaNetDevice::Receive(Ptr packet, Ptr senderDevice) // if (packetType != PACKET_OTHERHOST) { - m_snifferTrace(originalPacket); - m_macRxTrace(originalPacket); - m_rxCallback(this, packet, protocol, header.GetSource()); + m_snifferTrace(packet); + m_macRxTrace(packet); + m_rxCallback(this, pktCopy, protocol, header.GetSource()); } } diff --git a/src/csma/model/csma-net-device.h b/src/csma/model/csma-net-device.h index ff72aad2a..af092bfa6 100644 --- a/src/csma/model/csma-net-device.h +++ b/src/csma/model/csma-net-device.h @@ -172,7 +172,7 @@ class CsmaNetDevice : public NetDevice * \param p a reference to the received packet * \param sender the CsmaNetDevice that transmitted the packet in the first place */ - void Receive(Ptr p, Ptr sender); + void Receive(Ptr p, Ptr sender); /** * Is the send side of the network device enabled? From e442afd977f8408611f8f2942f3085eb9139bf52 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Fri, 6 Oct 2023 18:18:34 +0900 Subject: [PATCH 022/379] lr-wpan: Change CapabilityField to standard bitmap --- CHANGES.md | 1 + RELEASE_NOTES.md | 2 + src/lr-wpan/examples/lr-wpan-bootstrap.cc | 11 ++++-- src/lr-wpan/model/lr-wpan-fields.cc | 21 ----------- src/lr-wpan/model/lr-wpan-fields.h | 24 ------------ src/lr-wpan/model/lr-wpan-mac-pl-headers.cc | 26 +++++++------ src/lr-wpan/model/lr-wpan-mac-pl-headers.h | 16 ++++---- src/lr-wpan/model/lr-wpan-mac.h | 42 +++++++++++---------- 8 files changed, 56 insertions(+), 87 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fddd2c207..e6f86063e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,7 @@ Changes from ns-3.40 to ns-3-dev * (lte) Struct member `fdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `fdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. * (lte) Struct member `tdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `tdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. * (lte) Struct member `pfsFlowPerf_t::lastTtiBytesTrasmitted` in file `pf-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. + * (lr-wpan) Change the CapabilityField parameter in `LrWpanMac::MlmeAssociateRequest` and `LrWpanMac::MlmeAssociateIndication` to a standard bitmap. ### Changes to build system diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4748254c7..0bea5e6e6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,6 +20,8 @@ Release 3-dev ### New user-visible features +- (lr-wpan) !1686 Change CapabilityField to standard bitmap + ### Bugs fixed - (lr-wpan) !1673 - Fixes PHY BUSY_RX -> RX_ON operation diff --git a/src/lr-wpan/examples/lr-wpan-bootstrap.cc b/src/lr-wpan/examples/lr-wpan-bootstrap.cc index 787287219..964d51ec8 100644 --- a/src/lr-wpan/examples/lr-wpan-bootstrap.cc +++ b/src/lr-wpan/examples/lr-wpan-bootstrap.cc @@ -133,6 +133,7 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) assocParams.m_chPage = params.m_panDescList[panDescIndex].m_logChPage; assocParams.m_coordPanId = params.m_panDescList[panDescIndex].m_coorPanId; assocParams.m_coordAddrMode = params.m_panDescList[panDescIndex].m_coorAddrMode; + CapabilityField capability; if (params.m_panDescList[panDescIndex].m_coorAddrMode == LrWpanAddressMode::SHORT_ADDR) @@ -140,7 +141,7 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) assocParams.m_coordAddrMode = LrWpanAddressMode::SHORT_ADDR; assocParams.m_coordShortAddr = params.m_panDescList[panDescIndex].m_coorShortAddr; - assocParams.m_capabilityInfo.SetShortAddrAllocOn(true); + capability.SetShortAddrAllocOn(true); } else if (assocParams.m_coordAddrMode == LrWpanAddressMode::EXT_ADDR) { @@ -148,8 +149,9 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) assocParams.m_coordExtAddr = params.m_panDescList[panDescIndex].m_coorExtAddr; assocParams.m_coordShortAddr = Mac16Address("ff:fe"); - assocParams.m_capabilityInfo.SetShortAddrAllocOn(false); + capability.SetShortAddrAllocOn(false); } + assocParams.m_capabilityInfo = capability.GetCapability(); Simulator::ScheduleNow(&LrWpanMac::MlmeAssociateRequest, device->GetMac(), @@ -207,7 +209,10 @@ AssociateIndication(Ptr device, MlmeAssociateIndicationParams p assocRespParams.m_extDevAddr = params.m_extDevAddr; assocRespParams.m_status = LrWpanAssociationStatus::ASSOCIATED; - if (params.capabilityInfo.IsShortAddrAllocOn()) + CapabilityField capability; + capability.SetCapability(params.capabilityInfo); + + if (capability.IsShortAddrAllocOn()) { // Truncate the extended address and make an assigned // short address based on this. This mechanism is not described by the standard. diff --git a/src/lr-wpan/model/lr-wpan-fields.cc b/src/lr-wpan/model/lr-wpan-fields.cc index 7898c5a0e..0fee27885 100644 --- a/src/lr-wpan/model/lr-wpan-fields.cc +++ b/src/lr-wpan/model/lr-wpan-fields.cc @@ -525,27 +525,6 @@ CapabilityField::SetCapability(uint8_t bitmap) m_allocAddr = (bitmap >> 7) & (0x01); //!< Bit 7 } -uint32_t -CapabilityField::GetSerializedSize() const -{ - return 1; -} - -Buffer::Iterator -CapabilityField::Serialize(Buffer::Iterator i) const -{ - i.WriteU8(GetCapability()); - return i; -} - -Buffer::Iterator -CapabilityField::Deserialize(Buffer::Iterator i) -{ - uint8_t capability = i.ReadU8(); - SetCapability(capability); - return i; -} - bool CapabilityField::IsDeviceTypeFfd() const { diff --git a/src/lr-wpan/model/lr-wpan-fields.h b/src/lr-wpan/model/lr-wpan-fields.h index 79f3079e5..3bc1a6673 100644 --- a/src/lr-wpan/model/lr-wpan-fields.h +++ b/src/lr-wpan/model/lr-wpan-fields.h @@ -377,30 +377,6 @@ class CapabilityField */ void SetCapability(uint8_t bitmap); - /** - * Get the size of the serialized Capability Information Field. - * - * \return the size of the serialized field. - */ - uint32_t GetSerializedSize() const; - - /** - * Serialize the entire Capability Information Field. - * - * \param i an iterator which points to where the Capability information field - * should be written. - * \return an iterator. - */ - Buffer::Iterator Serialize(Buffer::Iterator i) const; - - /** - * Deserialize the entire Capability Information Field. - * - * \param i an iterator which points to where the Capability information field should be read. - * \return an iterator. - */ - Buffer::Iterator Deserialize(Buffer::Iterator i); - /** * True if the device type is a Full Functional Device (FFD) false if is a Reduced Functional * Device (RFD). 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 bd19ae278..f842dd9ed 100644 --- a/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc +++ b/src/lr-wpan/model/lr-wpan-mac-pl-headers.cc @@ -166,7 +166,7 @@ CommandPayloadHeader::GetSerializedSize() const switch (m_cmdFrameId) { case ASSOCIATION_REQ: - size += m_capabilityInfo.GetSerializedSize(); + size += 1; // (Capability field) break; case ASSOCIATION_RESP: size += 3; // (short address + Association Status) @@ -201,7 +201,7 @@ CommandPayloadHeader::Serialize(Buffer::Iterator start) const switch (m_cmdFrameId) { case ASSOCIATION_REQ: - i = m_capabilityInfo.Serialize(i); + i.WriteU8(m_capabilityInfo); break; case ASSOCIATION_RESP: WriteTo(i, m_shortAddr); @@ -240,7 +240,7 @@ CommandPayloadHeader::Deserialize(Buffer::Iterator start) switch (m_cmdFrameId) { case ASSOCIATION_REQ: - i = m_capabilityInfo.Deserialize(i); + m_capabilityInfo = i.ReadU8(); break; case ASSOCIATION_RESP: ReadFrom(i, m_shortAddr); @@ -278,13 +278,15 @@ CommandPayloadHeader::Print(std::ostream& os) const os << "| MAC Command Frame ID | = " << static_cast(m_cmdFrameId); switch (m_cmdFrameId) { - case ASSOCIATION_REQ: - os << "| Device Type FFD | = " << m_capabilityInfo.IsDeviceTypeFfd() - << "| Alternative Power Source available | = " << m_capabilityInfo.IsPowSrcAvailable() - << "| Receiver on when Idle | = " << m_capabilityInfo.IsReceiverOnWhenIdle() - << "| Security capable | = " << m_capabilityInfo.IsSecurityCapability() - << "| Allocate address on | = " << m_capabilityInfo.IsShortAddrAllocOn(); + case ASSOCIATION_REQ: { + CapabilityField capability(m_capabilityInfo); + os << "| Device Type FFD | = " << capability.IsDeviceTypeFfd() + << "| Alternative Power Source available | = " << capability.IsPowSrcAvailable() + << "| Receiver on when Idle | = " << capability.IsReceiverOnWhenIdle() + << "| Security capable | = " << capability.IsSecurityCapability() + << "| Allocate address on | = " << capability.IsShortAddrAllocOn(); break; + } case ASSOCIATION_RESP: os << "| Assigned Short Address | = " << m_shortAddr << "| Status Response | = " << m_assocStatus; @@ -310,6 +312,8 @@ CommandPayloadHeader::Print(std::ostream& os) const break; case CMD_RESERVED: break; + default: + break; } } @@ -320,7 +324,7 @@ CommandPayloadHeader::SetCommandFrameType(MacCommand macCommand) } void -CommandPayloadHeader::SetCapabilityField(CapabilityField cap) +CommandPayloadHeader::SetCapabilityField(uint8_t cap) { NS_ASSERT(m_cmdFrameId == ASSOCIATION_REQ); m_capabilityInfo = cap; @@ -409,7 +413,7 @@ CommandPayloadHeader::GetAssociationStatus() const return m_assocStatus; } -CapabilityField +uint8_t CommandPayloadHeader::GetCapabilityField() const { NS_ASSERT(m_cmdFrameId == ASSOCIATION_REQ); 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 fbb1df272..f740d5f03 100644 --- a/src/lr-wpan/model/lr-wpan-mac-pl-headers.h +++ b/src/lr-wpan/model/lr-wpan-mac-pl-headers.h @@ -161,7 +161,7 @@ class CommandPayloadHeader : public Header * Command). * \param cap The capability Information field */ - void SetCapabilityField(CapabilityField cap); + void SetCapabilityField(uint8_t cap); /** * Set the coordinator short address (16 bit address). * \param addr The coordinator short address. @@ -212,9 +212,9 @@ class CommandPayloadHeader : public Header /** * Get the Capability Information Field from the command payload header. * (Association Request Command) - * \return The Capability Information Field + * \return The Capability Information Field (8 bit bitmap) */ - CapabilityField GetCapabilityField() const; + uint8_t GetCapabilityField() const; /** * Get the coordinator short address. * \return The coordinator short address (16 bit address) @@ -237,11 +237,11 @@ class CommandPayloadHeader : public Header uint16_t GetPanId() const; private: - 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) + MacCommand m_cmdFrameId; //!< The command Frame Identifier (Used by all commands) + uint8_t 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) diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index a90cfac34..d506e017c 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -448,9 +448,9 @@ struct McpsDataIndicationParams */ struct MlmeAssociateIndicationParams { - Mac64Address m_extDevAddr; //!< The extended address of the device requesting association - CapabilityField capabilityInfo; //!< The operational capabilities of - //!< the device requesting association. + Mac64Address m_extDevAddr; //!< The extended address of the device requesting association + uint8_t capabilityInfo; //!< The operational capabilities of + //!< the device requesting association. uint8_t lqi{0}; //!< The link quality indicator of the received associate request command //!< (Not officially supported in the standard but found in implementations) }; @@ -512,8 +512,8 @@ struct MlmeSyncRequestParams */ struct MlmePollRequestParams { - LrWpanAddressMode m_coorAddrMode{ - SHORT_ADDR}; //!< The addressing mode of the coordinator to which the pool is intended. + LrWpanAddressMode m_coorAddrMode{SHORT_ADDR}; //!< The addressing mode of the coordinator + //!< to which the pool is intended. uint16_t m_coorPanId{0}; //!< The PAN id of the coordinator to which the poll is intended. Mac16Address m_coorShortAddr; //!< Coordinator short address. Mac64Address m_coorExtAddr; //!< Coordinator extended address. @@ -567,17 +567,17 @@ struct MlmeScanConfirmParams */ struct MlmeAssociateRequestParams { - uint8_t m_chNum{11}; //!< The channel number on which to attempt association. - uint32_t m_chPage{0}; //!< The channel page on which to attempt association. - uint8_t m_coordAddrMode{ - SHORT_ADDR}; //!< The coordinator addressing mode for this primitive and subsequent MPDU. - uint16_t m_coordPanId{0}; //!< The identifier of the PAN with which to associate. - Mac16Address - m_coordShortAddr; //!< The short address of the coordinator with which to associate. - Mac64Address - m_coordExtAddr; //!< The extended address of the coordinator with which to associate. - CapabilityField - m_capabilityInfo; //!< Specifies the operational capabilities of the associating device. + uint8_t m_chNum{11}; //!< The channel number on which to attempt association. + uint32_t m_chPage{0}; //!< The channel page on which to attempt association. + uint8_t m_coordAddrMode{SHORT_ADDR}; //!< The coordinator addressing mode for this + //!< primitive and subsequent MPDU. + uint16_t m_coordPanId{0}; //!< The identifier of the PAN with which to associate. + Mac16Address m_coordShortAddr; //!< The short address of the coordinator + //!< with which to associate. + Mac64Address m_coordExtAddr; //!< The extended address of the coordinator + //!< with which to associate. + uint8_t m_capabilityInfo; //!< Specifies the operational capabilities + //!< of the associating device (bitmap). }; /** @@ -589,7 +589,8 @@ struct MlmeAssociateConfirmParams { Mac16Address m_assocShortAddr; //!< The short address used in the association request LrWpanMlmeAssociateConfirmStatus m_status{ - MLMEASSOC_INVALID_PARAMETER}; //!< The status of a MLME-associate.request + MLMEASSOC_INVALID_PARAMETER}; //!< The status of + //!< a MLME-associate.request }; /** @@ -599,8 +600,8 @@ struct MlmeAssociateConfirmParams */ struct MlmeStartConfirmParams { - LrWpanMlmeStartConfirmStatus m_status{ - MLMESTART_INVALID_PARAMETER}; //!< The status of a MLME-start.request + LrWpanMlmeStartConfirmStatus m_status{MLMESTART_INVALID_PARAMETER}; //!< The status of + //!< a MLME-start.request }; /** @@ -624,7 +625,8 @@ struct MlmeBeaconNotifyIndicationParams struct MlmeSyncLossIndicationParams { LrWpanSyncLossReason m_lossReason{ - MLMESYNCLOSS_PAN_ID_CONFLICT}; //!< The reason for the lost of synchronization. + MLMESYNCLOSS_PAN_ID_CONFLICT}; //!< The reason for + //!< the lost of synchronization. uint16_t m_panId{0}; //!< The PAN identifier with which the device lost synchronization or to //!< which it was realigned. uint8_t m_logCh{11}; //!< The channel number on which the device lost synchronization or to From 2ab0550da8b9c3755253c5d1a4c96325658af944 Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Wed, 11 Oct 2023 12:01:43 +0100 Subject: [PATCH 023/379] Fix entry in CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e6f86063e..99d283c12 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,7 +24,7 @@ Changes from ns-3.40 to ns-3-dev * (lte) Struct member `fdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `fdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. * (lte) Struct member `tdbetsFlowPerf_t::lastTtiBytesTrasmitted` in file `tdbet-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. * (lte) Struct member `pfsFlowPerf_t::lastTtiBytesTrasmitted` in file `pf-ff-mac-scheduler.h` was renamed `fdbetsFlowPerf_t::lastTtiBytesTransmitted`. - * (lr-wpan) Change the CapabilityField parameter in `LrWpanMac::MlmeAssociateRequest` and `LrWpanMac::MlmeAssociateIndication` to a standard bitmap. +* (lr-wpan) Change the CapabilityField parameter in `LrWpanMac::MlmeAssociateRequest` and `LrWpanMac::MlmeAssociateIndication` to a standard bitmap. ### Changes to build system From 1b1654536d672b329f368aa1d5742c76425c176f Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Mon, 9 Oct 2023 19:30:54 +0100 Subject: [PATCH 024/379] utils: Remove extra new lines in the files created by create-module.py --- utils/create-module.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/create-module.py b/utils/create-module.py index 8aff7f1be..46ca29f8b 100755 --- a/utils/create-module.py +++ b/utils/create-module.py @@ -30,7 +30,6 @@ build_lib( TEST_SOURCES test/{MODULE}-test-suite.cc ${{examples_as_tests_sources}} ) - ''' @@ -108,7 +107,6 @@ build_lib_example( SOURCE_FILES {MODULE}-example.cc LIBRARIES_TO_LINK ${{lib{MODULE}}} ) - ''' EXAMPLE_CC_TEMPLATE = '''\ From 8558da228bdc01ed83d828ff53405f136dc7686f Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 7 Jun 2023 17:29:08 +0200 Subject: [PATCH 025/379] wifi: Enable setting the max modulation class supported by PHY --- src/wifi/model/wifi-phy.cc | 24 ++++++++++++++++++++++-- src/wifi/model/wifi-phy.h | 19 +++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc index 7d7958121..46d4aa8d9 100644 --- a/src/wifi/model/wifi-phy.cc +++ b/src/wifi/model/wifi-phy.cc @@ -349,6 +349,7 @@ WifiPhy::WifiPhy() m_currentEvent(nullptr), m_previouslyRxPpduUid(UINT64_MAX), m_standard(WIFI_STANDARD_UNSPECIFIED), + m_maxModClassSupported(WIFI_MOD_CLASS_UNKNOWN), m_band(WIFI_PHY_BAND_UNSPECIFIED), m_sifs(Seconds(0)), m_slot(Seconds(0)), @@ -946,6 +947,19 @@ WifiPhy::Configure80211be() AddPhyEntity(WIFI_MOD_CLASS_EHT, Create()); } +void +WifiPhy::SetMaxModulationClassSupported(WifiModulationClass modClass) +{ + NS_LOG_FUNCTION(this << modClass); + m_maxModClassSupported = modClass; +} + +WifiModulationClass +WifiPhy::GetMaxModulationClassSupported() const +{ + return m_maxModClassSupported; +} + void WifiPhy::ConfigureStandard(WifiStandard standard) { @@ -956,6 +970,11 @@ WifiPhy::ConfigureStandard(WifiStandard standard) m_standard = standard; + if (m_maxModClassSupported == WIFI_MOD_CLASS_UNKNOWN) + { + m_maxModClassSupported = GetModulationClassForStandard(m_standard); + } + if (!m_operatingChannel.IsSet()) { NS_LOG_DEBUG("Setting the operating channel first"); @@ -1864,8 +1883,9 @@ WifiPhy::StartReceivePreamble(Ptr ppdu, { NS_LOG_FUNCTION(this << ppdu << rxDuration); WifiModulationClass modulation = ppdu->GetModulation(); - auto it = m_phyEntities.find(modulation); - if (it != m_phyEntities.end()) + NS_ASSERT(m_maxModClassSupported != WIFI_MOD_CLASS_UNKNOWN); + if (auto it = m_phyEntities.find(modulation); + it != m_phyEntities.end() && modulation <= m_maxModClassSupported) { it->second->StartReceivePreamble(ppdu, rxPowersW, rxDuration); } diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h index 058065157..35958fa83 100644 --- a/src/wifi/model/wifi-phy.h +++ b/src/wifi/model/wifi-phy.h @@ -508,6 +508,20 @@ class WifiPhy : public Object */ virtual void ConfigureStandard(WifiStandard standard); + /** + * Set the maximum modulation class that has to be supported by this PHY object. + * The maximum modulation class supported will be the minimum between the given modulation + * class and the maximum modulation class supported based on the configured standard. + * + * \param modClass the given modulation class + */ + void SetMaxModulationClassSupported(WifiModulationClass modClass); + + /** + * \return the maximum modulation class that has to be supported by this PHY object. + */ + WifiModulationClass GetMaxModulationClassSupported() const; + /** * Get the configured Wi-Fi standard * @@ -1470,8 +1484,9 @@ class WifiPhy : public Object */ static std::map>& GetStaticPhyEntities(); - WifiStandard m_standard; //!< WifiStandard - WifiPhyBand m_band; //!< WifiPhyBand + WifiStandard m_standard; //!< WifiStandard + WifiModulationClass m_maxModClassSupported; //!< max modulation class supported + WifiPhyBand m_band; //!< WifiPhyBand ChannelTuple m_channelSettings; //!< Store operating channel settings until initialization WifiPhyOperatingChannel m_operatingChannel; //!< Operating channel bool m_fixedPhyBand; //!< True to prohibit changing PHY band after initialization From bb0d4f694e91241ef02a2ef4706ecc301032f711 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Tue, 6 Jun 2023 19:35:07 +0200 Subject: [PATCH 026/379] wifi: Make some EmlsrManager attributes not modifiable after construction --- src/wifi/model/eht/emlsr-manager.cc | 5 ++++- src/wifi/model/eht/emlsr-manager.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/wifi/model/eht/emlsr-manager.cc b/src/wifi/model/eht/emlsr-manager.cc index 178f792fb..0649b904d 100644 --- a/src/wifi/model/eht/emlsr-manager.cc +++ b/src/wifi/model/eht/emlsr-manager.cc @@ -59,12 +59,15 @@ EmlsrManager::GetTypeId() .AddAttribute( "MainPhyId", "The ID of the main PHY (position in the vector of PHYs held by " - "WifiNetDevice). This attribute cannot be set after initialization.", + "WifiNetDevice). This attribute cannot be set after construction.", + TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT, // prevent setting after construction UintegerValue(0), MakeUintegerAccessor(&EmlsrManager::SetMainPhyId, &EmlsrManager::GetMainPhyId), MakeUintegerChecker()) .AddAttribute("AuxPhyChannelWidth", "The maximum channel width (MHz) supported by Aux PHYs", + TypeId::ATTR_GET | + TypeId::ATTR_CONSTRUCT, // prevent setting after construction UintegerValue(20), MakeUintegerAccessor(&EmlsrManager::m_auxPhyMaxWidth), MakeUintegerChecker(20, 160)) diff --git a/src/wifi/model/eht/emlsr-manager.h b/src/wifi/model/eht/emlsr-manager.h index 2bec469ce..82ae1d995 100644 --- a/src/wifi/model/eht/emlsr-manager.h +++ b/src/wifi/model/eht/emlsr-manager.h @@ -73,14 +73,6 @@ class EmlsrManager : public Object */ std::optional