Difference between revisions of "GSOC2017Lte"

From Nsnam
Jump to: navigation, search
m (Fixed bugs)
 
(7 intermediate revisions by the same user not shown)
Line 14: Line 14:
  
 
* '''Code:''' https://bitbucket.org/labdsf/ns-3-dev
 
* '''Code:''' https://bitbucket.org/labdsf/ns-3-dev
 
* '''Documentation:''' https://bitbucket.org/labdsf/ns-3-dev
 
  
 
* '''About me:''' PhD student at [https://mipt.ru/en/ Moscow Institute of Physics and Technology].
 
* '''About me:''' PhD student at [https://mipt.ru/en/ Moscow Institute of Physics and Technology].
Line 26: Line 24:
 
Secondly, for the needs of scheduler, which is implemented according to LTE Femtocell Scheduler API, each cell is identified internally within eNB by its 8-bit identifier (componentCarrierId).
 
Secondly, for the needs of scheduler, which is implemented according to LTE Femtocell Scheduler API, each cell is identified internally within eNB by its 8-bit identifier (componentCarrierId).
  
On tho one hand, UE is unnecessarily aware of eNB configuration. componentCarrierIds are configured by LteHelper, so PHYs on eNB and UE correspond one-to-one. However, they don't have to, and it may be convenient to reserve componentCarrierId = 0 for primary CC on each UE. It is even possible that number of PHYs on eNB and UE is not equal.
+
On the one hand, UE is unnecessarily aware of eNB configuration. componentCarrierIds are configured by LteHelper, so PHYs on eNB and UE correspond one-to-one. However, they don't have to, and it may be convenient to reserve componentCarrierId = 0 for primary CC on each UE. It is even possible that number of PHYs on eNB and UE is not equal.
 
On the other hand, entities such as LteEnbNetDevice have "CellId" attributes, which correspond to "primary" component carrier. As "primary" component carrier is a property of UE, not eNB, it is necessary to remove such attributes.
 
On the other hand, entities such as LteEnbNetDevice have "CellId" attributes, which correspond to "primary" component carrier. As "primary" component carrier is a property of UE, not eNB, it is necessary to remove such attributes.
 +
 +
As distinction between primary and secondary carrier is done on each UE, any flags that identify primary carrier should be removed from eNB and scenario configuration.
 +
For example, ComponentCarrier class has "PrimaryCarrier" boolean attribute which should be removed.
  
 
General plan is as follows:
 
General plan is as follows:
Line 40: Line 41:
 
== Phase 1 (May 30, 2017 - June 30, 2017) ==
 
== Phase 1 (May 30, 2017 - June 30, 2017) ==
  
# Replace several Spectrum channels created by LteHelper with one Spectrum channel to make transition between cells easier. This way PHY should not need to switch Spectrum channels. PHY should be reconfigured but not linked against different channel object.
+
In Phase 1 I made UEs receive secondary cell configuration over the wireless channel during initial cell selection instead of requiring them to be preconfigured and made it possible to use any of the component carriers as primary, including scenarios where different UEs have different primary component carriers.
# Implement example scenario with one UE and one eNB with multiple component carriers. Attempt to trigger handover from one component carrier to another component carrier. This scenario may fail or even crash at this point, but it will be useful during development to identify the next step necessary to take.
+
 
# Start removing references to GetCellId and CellId attributes of LteEnbNetDevices.
+
# Made LteHelper create one SpectrumChannel for all carrier frequencies to allow PHYs to switch frequency without need to change the channel object.
 +
# Assigned different physical cell IDs to different component carriers of the same eNB.
 +
# Extended UeManager to track which cell ID is the primary component carrier for attached UE instead of assuming that primary cell is always on some fixed frequency.
 +
# Fixed serialization of RRC messages carrying secondary component carrier configuration and modified UE RRC to read it during initial connection configuration.
 +
# Made eNB transmit SIB1 (SystemInformationBlockType1) and SIB2 messages on all frequencies.
 +
# Implemented test suite <code>lte-test-secondary-cell-selection.cc</code> to test that UE can attach to any component carrier (not just the 0-th one) during initial cell selection. Run it with <code>./test.py -s lte-secondary-cell-selection</code>
 +
# Implemented test suite <code>lte-test-aggregation-throughput-scale.cc</code> to test that throughput scales linearly with number of CCs. It proves that initial configuration is correct in both downlink and uplink channels as UE transmits CQI (channel quality indicator) in uplink and eNB transmits data to UE in downlink using high MCS. Run it with <code>./test.py -s lte-aggregation-throughput-scale</code>
 +
 
 +
Report and code review:
 +
* [http://mailman.isi.edu/pipermail/ns-developers/2017-June/013983.html Phase 1 mailing list report]
 +
* [https://codereview.appspot.com/327850043 Phase 1 code review]
 +
 
 +
Code is already merged upstream:
 +
 
 +
* [https://code.nsnam.org/index.cgi/ns-3-dev/rev/bb02103e2b8d Official repository]
 +
* [https://github.com/nsnam/ns-3-dev-git/commit/6837edc5a961d0f1ba9332d4293934af87273e5d GitHub mirror]
  
 
== Phase 2 (June 30, 2017 - July 24, 2017) ==
 
== Phase 2 (June 30, 2017 - July 24, 2017) ==
  
# Improve CCM↔MAC interface on eNB to make sure CCM is informed about changes made to each UE configuration.  Add the ability to force reconfiguration of UE without actual RRC negotiation. Write a test that shows how to manually change secondary cell.
+
In phase 2 I made it possible to trigger UE handover with and without enabled CA (carrier aggregation) in inter-eNB, intra-eNB, inter-frequency and intra-frequency scenarios. Previously only inter-eNB intra-frequency handover was supported and only in non-CA scenarios.
# Make sure LteEnbRrcProtocolIdeal is able to deliver messages regardless of which CellId is used. Implement necessary interfaces on LteEnbNetDevice to make it possible to find corresponding LteEnbNetDevice by each of its CellIds.
+
 
# Refine RRCConnectionReconfiguration message handling to allow reconfiguration of secondary cells in the middle of simulation with proper RRC negotiation. Test that UE is able to receive reconfiguration message and reconfigure itself according to it.
+
# Modified EPC code to make it possible to identify eNB by any of its cell IDs instead of the first one.
 +
# Made sure LteEnbRrcProtocolIdeal is able to deliver messages regardless of which CellId is used.
 +
# Extended API to make it possible to specify target component carrier for handover.
 +
# Extended existing test suite <code>test-lte-handover-delay.cc</code> to make it possible to change the number of CCs. This test implements inter-eNB intra-frequency handover scenario and checks that delay is within limits. Run it with <code>./test.py -s lte-handover-delay</code>
 +
# Implemented a test suite <code>lte-test-primary-cell-change.cc</code> to extensively test all mentioned above handover cases (inter/intra-eNB, inter/intra-frequency, various number of CCs). Run it with <code>./test.py -s lte-primary-cell-change</code>
 +
 
 +
Report and code review:
 +
* [http://mailman.isi.edu/pipermail/ns-developers/2017-July/014047.html Phase 2 mailing list report]
 +
* [https://codereview.appspot.com/328170043/ Phase 2 and 3 code review]
 +
 
 +
Code passed review and is ready for merge.
  
 
== Phase 3 (July 28, 2017 - August 21, 2017) ==
 
== Phase 3 (July 28, 2017 - August 21, 2017) ==
  
# Improve CCM↔MAC interface on UE to make sure CCM has enough information to make decision about reconfiguration. Implement some example algorithm, such as round robin with a predefined time period that will decide when to handover. Write a test scenario or example showing how to use it.
+
# Updated MeasResults serialization according to 3GPP TS 36.331
# Implement some more realistic algorithm or, even better, integrate existing event-based handover algorithms.
+
# Created one measurement object for each CC to allow setting up measurement reports for SCells
 +
# Made it possible to setup A1 and A2 events for cells other than PCell
 +
# Extended existing A3 and A2/A4 algorithms to setup multiple MeasurementIds for each component carrier
 +
# Implemented a test suite <code>lte-test-secondary-cell-handover.cc</code> to test that A3 algorithm can perform inter-frequency handover based on A3 event measurements. Run it with <code>./test.py -s lte-secondary-cell-handover</code>
 +
 
 +
* [https://codereview.appspot.com/328170043/ Phase 2 and 3 code review]
 +
 
 +
= Project summary  =
 +
 
 +
In this section I briefly describe what I have done according to [https://developers.google.com/open-source/gsoc/help/work-product Work Product Submission Guidelines].
 +
 
 +
In the project I have implemented handover to secondary cell in NS-3 LTE model with enabled carrier aggregation. Implementation of this functionality allows developing and evaluating handover algorithms in multi-carrier scenarios.
 +
 
 +
The original implementation was mostly based on LTE Release 9 and supported only static carrier aggregation configuration, so all UEs had to use the same frequency for primary cell. I extended the model with LTE Release 10..12 improvements to support UE-specific configuration and dynamic reconfiguration. I improved the model to treat each component carrier as an independent cell able to support UEs configured to use it as their primary component carrier. To support dynamic reconfiguration I implemented previously unsupported intra-eNB inter-frequency handover and extended event-based measurement framework (A1, A2, A3, A4 events) to make it possible to use existing and implement new handover algorithms which make decisions based on secondary cell channel conditions besides already supported primary carrier measurements. All added functionality is tested by either implementing new test suites or extending existing ones.
 +
 
 +
The project was divided into three milestones:
 +
 
 +
# Make UE (User Equipment) receive configuration via RRC (Radio Resource Control) protocol and test the ability of UE to attach to any component carrier of eNB (Enhanced Node B) and receive configuration in runtime.
 +
# Make it possible to trigger manual handover in inter/intra-eNB and inter/intra-frequency cases. Test that handover is successfully performed.
 +
# Make it possible to collect measurements from secondary cells and perform automatic handover to secondary cell based on received measurements.
 +
 
 +
All patches are available in the form of Rietveld code reviews:
 +
 
 +
* [https://codereview.appspot.com/328170043/ Phase 1]
 +
* [https://codereview.appspot.com/328170043/ Phase 2 and 3 code review]
 +
 
 +
Most recent version of the code ready for merge is available at [https://bitbucket.org/labdsf/ns-3-dev/commits/branch/default Bitbucket]. The easiest way to obtain the code is to clone Mercurial repository from Bitbucket.
 +
 
 +
At this point all the planned milestones are reached. First milestone code is already merged upstream, second passed review and third is prepared for merge and submitted for review.
 +
 
 +
== Statistics ==
 +
 
 +
Phase 1 statistics
 +
 
 +
$ hg diff -c bb02103e2b8d | diffstat
 +
...
 +
28 files changed, 1136 insertions(+), 383 deletions(-)
 +
 
 +
Phase 2 and Phase 3 merge statistics:
 +
 
 +
$ hg diff -r 969140f099bb -r 413811934b31 | diffstat
 +
...
 +
53 files changed, 1537 insertions(+), 818 deletions(-)
 +
 
 +
== Fixed bugs ==
 +
 
 +
Some of the bugs encountered and fixed during GSoC are:
 +
 
 +
* [https://bitbucket.org/labdsf/ns-3-dev/commits/a512e8874ff5213e538984b44ce92d2423d4480a?at=default Made sure 300kHz spacing between CC is maintained as required by the standard.] See http://www.3gpp.org/technologies/keywords-acronyms/101-carrier-aggregation-explained for explanation on why it is necessary.
 +
* [https://bitbucket.org/labdsf/ns-3-dev/commits/1b97a9ad84e7933f012d479482af0a441d975973?at=default Detached PHY from the channel on reset to avoid crashes when some signal is in-flight during reset]
 +
* [https://bitbucket.org/labdsf/ns-3-dev/commits/bf596dc4887a030e144b083eedf4571a341baff6?at=default Removed unused variable]
 +
* [https://bitbucket.org/labdsf/ns-3-dev/commits/610318f10ae8fbafbd40035a0789953d028dd562?at=default Reset received signals on PHY reset to avoid SINR calculations with signals received from different channels]
 +
* [https://bitbucket.org/labdsf/ns-3-dev/commits/86b92b2c3a905ed724ddf42daee93700a4e1ef7b?at=default Fixed various RRC serialization bugs], opened [https://www.nsnam.org/bugzilla/show_bug.cgi?id=2754 bugzilla issue] for remaining bugs.
 +
 
 +
== Future work ==
 +
 
 +
Although all the planned work is done, here is a list of things that I plan to do after GSoC:
 +
 
 +
* Resolve any comments that may arise during code review and merge phase 2 and phase 3 code upstream.
 +
* Fix a [https://www.nsnam.org/bugzilla/show_bug.cgi?id=2754 noncritical bug] I discovered in RRC message serialization during project implementation.
 +
* Implement A6 event measurements. A6 event is triggered when some neighbor cell becomes better than secondary cell. A6 event configuration is transmitted in ASN.1 extension and [https://code.nsnam.org/index.cgi/ns-3-dev/file/a39655894155/src/lte/model/lte-asn1-header.cc#l309 serialization of extensions is not supported by NS-3 ASN.1 code yet], so it is impossible to implement right now and requires ASN.1 serialization API changes.

Latest revision as of 22:04, 28 August 2017

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

Return to GSoC 2017 Accepted Projects page.

Project overview

  • Project name: Enabling LTE CA handover to secondary cell
  • Abstract: The goal of the project is to implement handover to secondary cell, i.e. implement the ability to switch primary cell and reconfigure secondary carriers over RRC in runtime.

Technical Approach

In current LTE carrier aggregation (CA) model of ns-3 the handover among different component carriers is not supported. This is because the current LTE CA model does not treat different component carriers as different cells. Additionally, the primary component carrier is fixed and there is no procedure that allows change of a primary component carrier. In order to allow handover among component carriers, it is necessary to enhance SAP interfaces between RRC and component carrier manager (CCM), and also between CCM and lower layers (MAC, PHY) to allow change of primary component carrier, and also to extend the model so that each component carrier is treated as independent cell.

Currently cells have several identifiers. Firstly, according to LTE specifications, each cell has its own Cell ID. UE can learn this ID by communicating with eNB, so it always corresponds to Cell ID on eNB. Secondly, for the needs of scheduler, which is implemented according to LTE Femtocell Scheduler API, each cell is identified internally within eNB by its 8-bit identifier (componentCarrierId).

On the one hand, UE is unnecessarily aware of eNB configuration. componentCarrierIds are configured by LteHelper, so PHYs on eNB and UE correspond one-to-one. However, they don't have to, and it may be convenient to reserve componentCarrierId = 0 for primary CC on each UE. It is even possible that number of PHYs on eNB and UE is not equal. On the other hand, entities such as LteEnbNetDevice have "CellId" attributes, which correspond to "primary" component carrier. As "primary" component carrier is a property of UE, not eNB, it is necessary to remove such attributes.

As distinction between primary and secondary carrier is done on each UE, any flags that identify primary carrier should be removed from eNB and scenario configuration. For example, ComponentCarrier class has "PrimaryCarrier" boolean attribute which should be removed.

General plan is as follows:

  1. Improve architecture of LTE CA to make sure secondary cells are treated the same way as primary cells by eNB and frequency channels can be switched easily on UE.
  2. Implement minimally feasible version of handover procedure on eNB and UE and write unit tests for this procedure.
  3. Implement necessary signalling on RRC to make handover negotiation possible.
  4. Implement handover algorithm to make automatic handover possible.
  5. Write a scenario to validate implemented functionality and provide an example of usage for implemented functionality.

Milestones and Deliverables

Phase 1 (May 30, 2017 - June 30, 2017)

In Phase 1 I made UEs receive secondary cell configuration over the wireless channel during initial cell selection instead of requiring them to be preconfigured and made it possible to use any of the component carriers as primary, including scenarios where different UEs have different primary component carriers.

  1. Made LteHelper create one SpectrumChannel for all carrier frequencies to allow PHYs to switch frequency without need to change the channel object.
  2. Assigned different physical cell IDs to different component carriers of the same eNB.
  3. Extended UeManager to track which cell ID is the primary component carrier for attached UE instead of assuming that primary cell is always on some fixed frequency.
  4. Fixed serialization of RRC messages carrying secondary component carrier configuration and modified UE RRC to read it during initial connection configuration.
  5. Made eNB transmit SIB1 (SystemInformationBlockType1) and SIB2 messages on all frequencies.
  6. Implemented test suite lte-test-secondary-cell-selection.cc to test that UE can attach to any component carrier (not just the 0-th one) during initial cell selection. Run it with ./test.py -s lte-secondary-cell-selection
  7. Implemented test suite lte-test-aggregation-throughput-scale.cc to test that throughput scales linearly with number of CCs. It proves that initial configuration is correct in both downlink and uplink channels as UE transmits CQI (channel quality indicator) in uplink and eNB transmits data to UE in downlink using high MCS. Run it with ./test.py -s lte-aggregation-throughput-scale

Report and code review:

Code is already merged upstream:

Phase 2 (June 30, 2017 - July 24, 2017)

In phase 2 I made it possible to trigger UE handover with and without enabled CA (carrier aggregation) in inter-eNB, intra-eNB, inter-frequency and intra-frequency scenarios. Previously only inter-eNB intra-frequency handover was supported and only in non-CA scenarios.

  1. Modified EPC code to make it possible to identify eNB by any of its cell IDs instead of the first one.
  2. Made sure LteEnbRrcProtocolIdeal is able to deliver messages regardless of which CellId is used.
  3. Extended API to make it possible to specify target component carrier for handover.
  4. Extended existing test suite test-lte-handover-delay.cc to make it possible to change the number of CCs. This test implements inter-eNB intra-frequency handover scenario and checks that delay is within limits. Run it with ./test.py -s lte-handover-delay
  5. Implemented a test suite lte-test-primary-cell-change.cc to extensively test all mentioned above handover cases (inter/intra-eNB, inter/intra-frequency, various number of CCs). Run it with ./test.py -s lte-primary-cell-change

Report and code review:

Code passed review and is ready for merge.

Phase 3 (July 28, 2017 - August 21, 2017)

  1. Updated MeasResults serialization according to 3GPP TS 36.331
  2. Created one measurement object for each CC to allow setting up measurement reports for SCells
  3. Made it possible to setup A1 and A2 events for cells other than PCell
  4. Extended existing A3 and A2/A4 algorithms to setup multiple MeasurementIds for each component carrier
  5. Implemented a test suite lte-test-secondary-cell-handover.cc to test that A3 algorithm can perform inter-frequency handover based on A3 event measurements. Run it with ./test.py -s lte-secondary-cell-handover

Project summary

In this section I briefly describe what I have done according to Work Product Submission Guidelines.

In the project I have implemented handover to secondary cell in NS-3 LTE model with enabled carrier aggregation. Implementation of this functionality allows developing and evaluating handover algorithms in multi-carrier scenarios.

The original implementation was mostly based on LTE Release 9 and supported only static carrier aggregation configuration, so all UEs had to use the same frequency for primary cell. I extended the model with LTE Release 10..12 improvements to support UE-specific configuration and dynamic reconfiguration. I improved the model to treat each component carrier as an independent cell able to support UEs configured to use it as their primary component carrier. To support dynamic reconfiguration I implemented previously unsupported intra-eNB inter-frequency handover and extended event-based measurement framework (A1, A2, A3, A4 events) to make it possible to use existing and implement new handover algorithms which make decisions based on secondary cell channel conditions besides already supported primary carrier measurements. All added functionality is tested by either implementing new test suites or extending existing ones.

The project was divided into three milestones:

  1. Make UE (User Equipment) receive configuration via RRC (Radio Resource Control) protocol and test the ability of UE to attach to any component carrier of eNB (Enhanced Node B) and receive configuration in runtime.
  2. Make it possible to trigger manual handover in inter/intra-eNB and inter/intra-frequency cases. Test that handover is successfully performed.
  3. Make it possible to collect measurements from secondary cells and perform automatic handover to secondary cell based on received measurements.

All patches are available in the form of Rietveld code reviews:

Most recent version of the code ready for merge is available at Bitbucket. The easiest way to obtain the code is to clone Mercurial repository from Bitbucket.

At this point all the planned milestones are reached. First milestone code is already merged upstream, second passed review and third is prepared for merge and submitted for review.

Statistics

Phase 1 statistics

$ hg diff -c bb02103e2b8d | diffstat
...
28 files changed, 1136 insertions(+), 383 deletions(-)

Phase 2 and Phase 3 merge statistics:

$ hg diff -r 969140f099bb -r 413811934b31 | diffstat
...
53 files changed, 1537 insertions(+), 818 deletions(-)

Fixed bugs

Some of the bugs encountered and fixed during GSoC are:

Future work

Although all the planned work is done, here is a list of things that I plan to do after GSoC:

  • Resolve any comments that may arise during code review and merge phase 2 and phase 3 code upstream.
  • Fix a noncritical bug I discovered in RRC message serialization during project implementation.
  • Implement A6 event measurements. A6 event is triggered when some neighbor cell becomes better than secondary cell. A6 event configuration is transmitted in ASN.1 extension and serialization of extensions is not supported by NS-3 ASN.1 code yet, so it is impossible to implement right now and requires ASN.1 serialization API changes.