Skip to content

Commit ac8052d

Browse files
authored
Make frame number uint32_t in PHY and MAC classes, update README and various fixes (#98)
* Make frame number uint32_t in PHY and MAC classes * Fix logs
1 parent cac1f4d commit ac8052d

21 files changed

+119
-141
lines changed

README.md

Lines changed: 67 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,96 @@
1-
# The Network Simulator, Version 3
1+
# mmWave ns-3 module #
22

3-
## Table of Contents
3+
This is an [ns-3](https://www.nsnam.org "ns-3 Website") module for the simulation
4+
of 5G cellular networks operating at mmWaves. A description of this module can be found in [this paper](https://ieeexplore.ieee.org/document/8344116/ "mmwave paper").
45

5-
1) [An overview](#an-open-source-project)
6-
2) [Building ns-3](#building-ns-3)
7-
3) [Running ns-3](#running-ns-3)
8-
4) [Getting access to the ns-3 documentation](#getting-access-to-the-ns-3-documentation)
9-
5) [Working with the development version of ns-3](#working-with-the-development-version-of-ns-3)
6+
Main features:
107

11-
> **NOTE**: Much more substantial information about ns-3 can be found at
12-
<https://www.nsnam.org>
8+
* Support of a wide range of channel models, including the model based on 3GPP TR 38.901 for frequencies between 0.5 and 100 GHz. Ray tracing and measured traces can also be used.
139

14-
## An Open Source project
10+
* Custom PHY and MAC classes supporting the 3GPP NR frame structure and numerologies.
1511

16-
ns-3 is a free open source project aiming to build a discrete-event
17-
network simulator targeted for simulation research and education.
18-
This is a collaborative project; we hope that
19-
the missing pieces of the models we have not yet implemented
20-
will be contributed by the community in an open collaboration
21-
process.
12+
* Custom schedulers for supporting dynamic TDD formats
2213

23-
The process of contributing to the ns-3 project varies with
24-
the people involved, the amount of time they can invest
25-
and the type of model they want to work on, but the current
26-
process that the project tries to follow is described here:
27-
<https://www.nsnam.org/developers/contributing-code/>
14+
* Carrier Aggregation at the MAC layer
2815

29-
This README excerpts some details from a more extensive
30-
tutorial that is maintained at:
31-
<https://www.nsnam.org/documentation/latest/>
16+
* Enhancements to the RLC layer with re-segmentation of packets for retransmissions
3217

33-
## Building ns-3
18+
* Dual Connectivity with LTE base stations, with fast secondary cell handover and channel tracking
3419

35-
The code for the framework and the default models provided
36-
by ns-3 is built as a set of libraries. User simulations
37-
are expected to be written as simple programs that make
38-
use of these ns-3 libraries.
20+
* Simulation of core network elements (with also the MME as a real node)
3921

40-
To build the set of default libraries and the example
41-
programs included in this package, you need to use the
42-
tool 'ns3'. Detailed information on how to use ns3 is
43-
included in the file doc/build.txt
22+
## Installation
23+
This repository contains a complete ns-3 installation with the addition of the mmwave module.
4424

45-
However, the real quick and dirty way to get started is to
46-
type the command
47-
48-
```shell
49-
./ns3 configure --enable-examples
25+
Use these commands to download and build `ns3-mmwave`:
5026
```
51-
52-
followed by
53-
54-
```shell
55-
./ns3
27+
git clone https://github.com/nyuwireless-unipd/ns3-mmwave.git
28+
cd ns3-mmwave
29+
./ns3 configure --disable-python --enable-examples && ./ns3 build
5630
```
5731

58-
in the directory which contains this README file. The files
59-
built will be copied in the build/ directory.
60-
61-
The current codebase is expected to build and run on the
62-
set of platforms listed in the [release notes](RELEASE_NOTES.md)
63-
file.
32+
## Usage example
33+
You can use the following command to run the `mmwave-simple-epc` example.
34+
```
35+
./ns3 --run mmwave-simple-epc
36+
```
37+
Other examples are included in `src/mmwave/examples/`
6438

65-
Other platforms may or may not work: we welcome patches to
66-
improve the portability of the code to these other platforms.
39+
## Documentation
40+
The documentation of this module is available at [this link](./src/mmwave/doc/mmwave-doc.md).
6741

68-
## Running ns-3
42+
## Related modules
43+
- MilliCar is an ns-3 module for the simulation of mmWave NR V2X networks. Check [this repo](https://github.com/signetlabdei/millicar) for further details.
44+
- A seperate module is being developed for [mmWave UE Energy Consumption](https://github.com/arghasen10/mmwave-energy "mmwave-energy"). You can use this module for analyzing
45+
Energy Consumption behaviour of mmwave UE. Check this repository for further details.
46+
- `ns3-mmwave-iab` is an extended version of `ns3-mmWave` adding wireless relaying capabilities to an ns-3 NetDevice, and the possibility of simulating in-band relaying at mmWave frequencies. Check [this repo](https://github.com/signetlabdei/ns3-mmwave-iab) for further details.
6947

70-
On recent Linux systems, once you have built ns-3 (with examples
71-
enabled), it should be easy to run the sample programs with the
72-
following command, such as:
48+
## References
49+
The following papers describe in detail the features implemented in the mmWave
50+
module:
51+
- [End-to-End Simulation of 5G mmWave Networks](https://ieeexplore.ieee.org/document/8344116/ "comst paper") is a comprehensive tutorial with a detailed description of the whole module. We advise the researchers interested in this module to start reading from this paper;
52+
- [Integration of Carrier Aggregation and Dual Connectivity for the ns-3 mmWave Module](https://arxiv.org/abs/1802.06706 "wns3 2018") describes the Carrier Aggregation implementation;
53+
- [Implementation of A Spatial Channel Model for ns-3](https://arxiv.org/abs/2002.09341 "wns3 2020") describes the integration of the spatial channel model based on the 3GPP specifications TR 38.901 V15.0.0;
54+
- [Performance Comparison of Dual Connectivity and Hard Handover for LTE-5G Tight Integration](https://arxiv.org/abs/1607.05425 "simutools paper") describes the Dual Connectivity feature.
7355

74-
```shell
75-
./ns3 run simple-global-routing
76-
```
56+
These other papers describe features that were implemented in older releases:
57+
- [ns-3 Implementation of the 3GPP MIMO Channel Model for Frequency Spectrum above 6 GHz](https://dl.acm.org/citation.cfm?id=3067678 "wns3 2017") describes the implementation of the 3GPP channel model based on TR 38.900;
58+
- [Multi-Sector and Multi-Panel Performance in 5G mmWave Cellular Networks](https://arxiv.org/abs/1808.04905 "globecom2018") describes the multi-sector addition to the 3GPP channel model;
7759

78-
That program should generate a `simple-global-routing.tr` text
79-
trace file and a set of `simple-global-routing-xx-xx.pcap` binary
80-
pcap trace files, which can be read by `tcpdump -tt -r filename.pcap`
81-
The program source can be found in the examples/routing directory.
60+
If you use this module in your research, please cite:
8261

83-
## Getting access to the ns-3 documentation
62+
M. Mezzavilla, M. Zhang, M. Polese, R. Ford, S. Dutta, S. Rangan, M. Zorzi, _"End-to-End Simulation of 5G mmWave Networks,"_ in IEEE Communications Surveys & Tutorials, vol. 20, no. 3, pp. 2237-2263, thirdquarter 2018. [bibtex available here](https://ieeexplore.ieee.org/document/8344116/)
8463

85-
Once you have verified that your build of ns-3 works by running
86-
the simple-point-to-point example as outlined in 3) above, it is
87-
quite likely that you will want to get started on reading
88-
some ns-3 documentation.
64+
## Future work
65+
We are actively developing new features for the mmWave module, including:
66+
- 3GPP NR beam tracking
67+
- 3GPP NR Integrated Access and Backhaul feature (see [this repo](https://github.com/signetlabdei/ns3-mmwave-iab) for more details)
8968

90-
All of that documentation should always be available from
91-
the ns-3 website: <https://www.nsnam.org/documentation/>.
69+
## About
70+
This module is being developed by [NYU Wireless](http://wireless.engineering.nyu.edu/) and the [University of Padova](http://mmwave.dei.unipd.it/).
71+
This work was supported in part by the U.S. Department of Commerce National Institute of Standards and Technology through the Project “An End-to-End Research Platform for Public Safety Communications above 6 GHz” under Award 70NANB17H16.
9272

93-
This documentation includes:
9473

95-
- a tutorial
96-
- a reference manual
97-
- models in the ns-3 model library
98-
- a wiki for user-contributed tips: <https://www.nsnam.org/wiki/>
99-
- API documentation generated using doxygen: this is
100-
a reference manual, most likely not very well suited
101-
as introductory text:
102-
<https://www.nsnam.org/doxygen/index.html>
10374

104-
## Working with the development version of ns-3
75+
<!-- The new-handover branch offers integration between LTE and mmWave and dual connectivity features.
76+
-->
10577

106-
If you want to download and use the development version of ns-3, you
107-
need to use the tool `git`. A quick and dirty cheat sheet is included
108-
in the manual, but reading through the git
109-
tutorials found in the Internet is usually a good idea if you are not
110-
familiar with it.
78+
## Authors ##
11179

112-
If you have successfully installed git, you can get
113-
a copy of the development version with the following command:
80+
The ns-3 mmWave module is the result of the development effort carried out by different people. The main contributors are:
81+
- Tommaso Zugno, University of Padova
82+
- Michele Polese, University of Padova
83+
- Matteo Pagin, University of Padova
84+
- Mattia Lecci, University of Padova
85+
- Matteo Drago, University of Padova
86+
- Mattia Rebato, University of Padova
87+
- Menglei Zhang, NYU Wireless
88+
- Marco Giordani, University of Padova
89+
- Marco Mezzavilla, NYU Wireless
90+
- Sourjya Dutta, NYU Wireless
91+
- Russell Ford, NYU Wireless
92+
- Gabriel Arrobo, Intel
11493

115-
```shell
116-
git clone https://gitlab.com/nsnam/ns-3-dev.git
117-
```
94+
## License ##
11895

119-
However, we recommend to follow the Gitlab guidelines for starters,
120-
that includes creating a Gitlab account, forking the ns-3-dev project
121-
under the new account's name, and then cloning the forked repository.
122-
You can find more information in the [manual](https://www.nsnam.org/docs/manual/html/working-with-git.html).
96+
This software is licensed under the terms of the GNU GPLv2, as like as ns-3. See the LICENSE file for more details.

src/mmwave/examples/mmwave-amc-test.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
using namespace ns3;
4444
using namespace mmwave;
4545

46+
NS_LOG_COMPONENT_DEFINE ("MmwaveAmcTest");
47+
4648
double snrUpdateIntervalMs = 100.0; // in ms
4749
double snrIncDb = 0.1; // increment by 10 meters
4850
double snrMinDb = -7.0; // eNB-UE distance in meters
@@ -75,11 +77,11 @@ void updateSnr (double snrInit, Ptr<MmWaveEnbNetDevice> enbDev, Ptr<SpectrumMode
7577
mcsTmp = mcs;
7678
}
7779
enbDev->GetMac ()->SetMcs (mcs);
78-
std::cout << "************* SINR changing to " << snrInit << " (MCS = " << +mcs << " ) *************" << std::endl;
79-
8080
Simulator::Schedule (MicroSeconds (3 * 100), &MmWaveSpectrumPhy::UpdateSinrPerceived,
8181
enbDev->GetPhy ()->GetDlSpectrumPhy (), specVals);
8282

83+
NS_LOG_INFO("************* SINR changing to " << snrInit << " (MCS = " << +mcs << " ) *************");
84+
8385
if (snrInit > snrMaxDb)
8486
{
8587
return;
@@ -185,7 +187,6 @@ main (int argc, char *argv[])
185187
amc);
186188

187189
Simulator::Stop (Seconds (simTime));
188-
NS_LOG_UNCOND ("Simulation running for " << simTime << " seconds");
189190
Simulator::Run ();
190191
Simulator::Destroy ();
191192
return 0;

src/mmwave/examples/mmwave-amc-test2.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@
4242
using namespace ns3;
4343
using namespace mmwave;
4444

45+
NS_LOG_COMPONENT_DEFINE ("MmwaveAmcTest2");
46+
4547
double updateInterval = 2000.0; // in ms
4648
double increment = 0.5; // increment by x dB
4749
double lossMin = 100.0;
4850
double lossMax = 145.0;
4951

5052
void updateLoss (double loss, Ptr<MmWavePropagationLossModel> model)
5153
{
54+
NS_LOG_INFO("************* Path loss changing to " << loss << " *************");
55+
5256
model->SetLossFixedDb (loss);
53-
std::cout << "************* Path loss changing to " << loss << " *************" << std::endl;
5457
if (loss >= lossMax)
5558
{
5659
return;

src/mmwave/model/mmwave-enb-mac.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ MmWaveEnbMac::DoSlotIndication (SfnSf sfnSf)
542542
uint8_t delayedSlotNum = (m_slotNum + m_phyMacConfig->GetL1L2Latency ()) % m_phyMacConfig->GetSlotsPerSubframe ();
543543
uint8_t deltaSubframe = (m_slotNum + m_phyMacConfig->GetL1L2Latency ()) / m_phyMacConfig->GetSlotsPerSubframe ();
544544
uint8_t delayedSchedSfNum = (m_sfNum + deltaSubframe) % m_phyMacConfig->GetSubframesPerFrame ();
545-
uint16_t delayedSchedFrameNum = m_frameNum + ((m_sfNum + deltaSubframe) / m_phyMacConfig->GetSubframesPerFrame ());
545+
uint32_t delayedSchedFrameNum = m_frameNum + ((m_sfNum + deltaSubframe) / m_phyMacConfig->GetSubframesPerFrame ());
546546

547547
NS_ASSERT ((delayedSlotNum < m_phyMacConfig->GetSlotsPerSubframe ()) && (delayedSchedSfNum < m_phyMacConfig->GetSubframesPerFrame ())
548548
&& (deltaSubframe >= 0) && (delayedSlotNum >= 0) && (delayedSchedSfNum >= 0) && (delayedSchedFrameNum >= m_frameNum));

src/mmwave/model/mmwave-enb-mac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class MmWaveEnbMac : public Object
223223
/// component carrier Id used to address sap
224224
uint8_t m_componentCarrierId;
225225

226-
uint16_t m_frameNum;
226+
uint32_t m_frameNum;
227227
uint8_t m_sfNum;
228228
uint8_t m_slotNum;
229229

src/mmwave/model/mmwave-flex-tti-mac-scheduler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ MmWaveFlexTtiMacScheduler::DoSchedUlCqiInfoReq (const struct MmWaveMacSchedSapPr
381381
{
382382
NS_LOG_FUNCTION (this);
383383

384-
uint16_t frameNum = params.m_sfnSf.m_frameNum;
384+
uint32_t frameNum = params.m_sfnSf.m_frameNum;
385385
uint8_t subframeNum = params.m_sfnSf.m_sfNum;
386386
uint8_t slotNum = params.m_sfnSf.m_slotNum;
387387
uint8_t symNum = params.m_sfnSf.m_symStart;
@@ -658,7 +658,7 @@ MmWaveFlexTtiMacScheduler::DoSchedTriggerReq (const struct MmWaveMacSchedSapProv
658658
{
659659
NS_LOG_FUNCTION (this);
660660

661-
uint16_t frameNum = params.m_snfSf.m_frameNum;
661+
uint32_t frameNum = params.m_snfSf.m_frameNum;
662662
uint8_t sfNum = params.m_snfSf.m_sfNum;
663663
uint8_t slotNum = params.m_snfSf.m_slotNum;
664664

src/mmwave/model/mmwave-flex-tti-mac-scheduler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ class MmWaveFlexTtiMacScheduler : public MmWaveMacScheduler
184184

185185
bool DoSchedDlTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params,
186186
MmWaveMacSchedSapUser::SchedConfigIndParameters& ret,
187-
unsigned int frameNum,
187+
uint32_t frameNum,
188188
unsigned int sfNum,
189189
unsigned int islot);
190190

191191
bool DoSchedUlTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params,
192192
MmWaveMacSchedSapUser::SchedConfigIndParameters& ret,
193-
unsigned int frameNum,
193+
uint32_t frameNum,
194194
unsigned int sfNum,
195195
unsigned int islot);
196196

src/mmwave/model/mmwave-flex-tti-maxrate-mac-scheduler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ MmWaveFlexTtiMaxRateMacScheduler::DoSchedUlCqiInfoReq (const struct MmWaveMacSch
451451
{
452452
NS_LOG_FUNCTION (this);
453453

454-
unsigned frameNum = params.m_sfnSf.m_frameNum;
454+
uint32_t frameNum = params.m_sfnSf.m_frameNum;
455455
unsigned subframeNum = params.m_sfnSf.m_sfNum;
456456
unsigned startSymIdx = params.m_sfnSf.m_slotNum;
457457

@@ -750,7 +750,7 @@ unsigned MmWaveFlexTtiMaxRateMacScheduler::CalcMinTbSizeNumSym (unsigned mcs, un
750750
void
751751
MmWaveFlexTtiMaxRateMacScheduler::DoSchedTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params)
752752
{
753-
uint16_t frameNum = params.m_snfSf.m_frameNum;
753+
uint32_t frameNum = params.m_snfSf.m_frameNum;
754754
uint8_t sfNum = params.m_snfSf.m_sfNum;
755755
uint8_t slotNum = params.m_snfSf.m_slotNum;
756756

src/mmwave/model/mmwave-flex-tti-maxrate-mac-scheduler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ class MmWaveFlexTtiMaxRateMacScheduler : public MmWaveMacScheduler
277277

278278
bool DoSchedDlTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params,
279279
MmWaveMacSchedSapUser::SchedConfigIndParameters& ret,
280-
unsigned int frameNum,
280+
uint32_t frameNum,
281281
unsigned int sfNum,
282282
unsigned int islot);
283283

284284
bool DoSchedUlTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params,
285285
MmWaveMacSchedSapUser::SchedConfigIndParameters& ret,
286-
unsigned int frameNum,
286+
uint32_t frameNum,
287287
unsigned int sfNum,
288288
unsigned int islot);
289289

src/mmwave/model/mmwave-flex-tti-maxweight-mac-scheduler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ MmWaveFlexTtiMaxWeightMacScheduler::DoSchedUlCqiInfoReq (const struct MmWaveMacS
451451
{
452452
NS_LOG_FUNCTION (this);
453453

454-
uint16_t frameNum = params.m_sfnSf.m_frameNum;
454+
uint32_t frameNum = params.m_sfnSf.m_frameNum;
455455
uint8_t subframeNum = params.m_sfnSf.m_sfNum;
456456
uint8_t slotNum = params.m_sfnSf.m_slotNum;
457457
uint8_t symNum = params.m_sfnSf.m_symStart;
@@ -751,7 +751,7 @@ unsigned MmWaveFlexTtiMaxWeightMacScheduler::CalcMinTbSizeNumSym (unsigned mcs,
751751
void
752752
MmWaveFlexTtiMaxWeightMacScheduler::DoSchedTriggerReq (const struct MmWaveMacSchedSapProvider::SchedTriggerReqParameters& params)
753753
{
754-
uint16_t frameNum = params.m_snfSf.m_frameNum;
754+
uint32_t frameNum = params.m_snfSf.m_frameNum;
755755
uint8_t sfNum = params.m_snfSf.m_sfNum;
756756
uint8_t slotNum = params.m_snfSf.m_slotNum;
757757

0 commit comments

Comments
 (0)