From Nsnam
Revision as of 07:19, 10 June 2018 by (Talk | contribs) (Weekly Reports: Week 4 and first phase evaluation)

Jump to: navigation, search

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 2018 Accepted Projects page.

Project overview

  • Project name: Merging and Improvement of the LTE and Wi-Fi Coexistence Module
  • Abstract: The LTE and Wi-Fi Coexistence Module which implements 3GPP specification of License Assisted Access (LAA) and the interfacing of LTE and Wi-Fi module in ns-3, has been quite popular with ns-3 users. But the current work on the module is far removed from the mainline development, thus missing improvements that has been implemented on the upstream. It is hard to apply patch from upstream to the module, and inversely, merge the module to upstream. Moreover, it is also created to implement TR 36.889 test scenarios, making it difficult to customize for other cases. Furthermore, more improvement ideas can be implemented to streamline and improve readability of the simulation scenario. Some key features missing from the unit test (e.g., LAA backoff), will also be implemented. The goal of the project will be to merge the existing module to be in-line with upstream, improve the usability of the module, and additionally, merge useful improvements that are independent from the LTE-Wi-Fi coexistence to the upstream ns-3-dev.
  • About me: I am an admitted PhD student of the Computer Science Departement of University of Chicago starting next September. Previously, I did my Master Studies at the National Taiwan University of Science and Technology (NTUST), Taiwan. Since my current research focus is on the LTE and Wi-Fi Coexistence, I have taken a large interest in improving the module. I have been working with Tom Henderson for quite some time to merge the module to the upstream, and doing it under GSoC wil hopefully accelerate the progress.

Technical Approach

The goal of this project is to make available to ns-3 users the LTE and Wi-Fi Coexistence module based on the current ns-3. This involves porting and upstreaming changes to the LTE, Wi-Fi, and applications modules, and improving the LAA-related code. The plan is to port the existing code with 3GPP scenario, including tests and documentation, and then if time remaining, to make improvements to the module.

The first step will be modifying the LTE and Wi-Fi modules to better interface the two modules. Some of these modifications have been implemented, for instance: a spectrum-aware PHY model for Wi-Fi; but most of the modifications will be on LTE module: porting the LAA codes to the new carrier aggregation code, implementing HARQ feedback and backoff, and channel access.

In addition to new codes, this preliminary works will also includes fixing bugs (e.g., "bug 2399", "bug 2470") and implementing new requested features (e.g., FileTransferApplication, and roaming capability for Wi-Fi).

After the preliminary modifications, the next step will be merging the current available work of ns-3-lbt repository along with improvements. The current LTE and Wi-Fi Coexistence Module has an addition of "experiments" component which holds scripts for 3GPP TR 36.889 test cases. Because the test cases are similar, those test scenarios are calling ScenarioHelper class in the helper component to set up everything. An improvement to ScenarioHelper is proposed, so that users can modify much more simulation parameters for their own scenario.

The end results will be an improved LTE and Wi-Fi Coexistence Module that is separated but still in-line with upstream. This module will be a contributed extension and hosted at the new ns-3 App Store. Additionally, any improvements that are independent to the LTE-Wi-Fi coexistence case will be merged to the upstream.

Milestones and Deliverables

The GSoC period is divided into 3 phases. The planned deliverables at the end of each phase is as mentioned below. If other contributors can make progress on some of these porting issues, then we can start Phase 3 work earlier.

Phase 1: Wi-Fi and Applications

  • Resolve "bug 2399" on introducing roaming capability to STA Wi-Fi
  • Resolve "bug 2470" on handshake to set up Block Ack Agreement (which leads to zero throughput for some AP/STA combinations)
  • Implementation of FileTransferApplication according to previous works with the addition of FileSrc attribute for adding file input.
  • Any other additional porting and bug fixing necessary to be able to run the Wi-Fi (cell A), Wi-Fi (cell B) scenario.
    • SpectrumWifiPhy support for channels other than 36, 40, 44, and 48
    • Wifi MAC fails assertion on simulation with many devices
    • Problem with tracing dropped packets
    • InterferenceHelper gives negative trace value for Interference Power

Phase 2: LTE port

  • Follow the CTTC step-by-step guide for porting the LTE portions of the LAA code to the new carrier aggregation code.
  • Test additional parts of the LAA code involving LBT including HARQ feedback and backoff, and channel access.
  • Any other documentation and testing, and bug fixing, necessary to replicate the original functionality of the code.

Phase 3: Finalize

  • Merge the rest of ns-3-lbt, this includes models, examples, helper classes, experiments, and unit tests.
  • Implement LAA backoff test and improve the unit test for LbtAccessManager to include uncovered tests.
  • Improve the flexibility of the ScenarioHelper (or adding new helpers), so that users should be able to modify more parameters from their own scenario, such as:
    • The number of cell group (currently only two cell groups).
    • Different application starting time for each cell.
    • Granularly control each node’s parameter (e.g., LBT TXOP, Minimum and Maximum CW)
  • Finalize documentation and testing for the new module.

Weekly Reports

Community Bonding Phase (April 24th-May 13th)


  • Finalized overall plan and timeline for implementing compability patches for both Wi-Fi and LTE module with mentor.
  • Met and discussed with other collaborator on the LTE compability patches.
  • The plan for the first step of Wi-Fi patch: improvement to the MAC model of Wi-Fi Station has been created. The merge plan can be viewed here.
  • Set up repository for the personal works which can be accessed here
  • Briefed on the steps to request code merge to upstream.

Week 1 (May 14th-May 20th)

Tasks Completed:

  • Reviewed previous patches that was posted to bugzilla [1] [2].
  • Finalized patch plan based on the previous patch review, mentor's and collaborator's feedback.
  • Implemented the patch plan and reviewed it with mentors.
  • Identified problems after the code review, decided to reduce the scope of the bug fix.


The first week of coding phase was spent to implement improvements to the MAC model of Wi-Fi Station and resolve bug 2399. I implemented the finalized patch plan but after discussing the codes with mentors, we identified more problems:

  • The roaming behavior of STA has made the code more complex, the amount of channels that need to be roamed can be large and therefore can make the scanning timeout too long.
  • REFUSED state of StaWifiMac is a dead end, may need to be automatically resolved.
  • ASSOCIATED state should be sticky unless not recoverable: may need to add reassociation procedure on MissedBeacon event.

We then decided on these following steps of patches:

  1. Update documentation based on the current upstream implementation: add information on Wifi docs about current scanning & association process, and update state graph on code.
  2. Refactor sta-wifi-mac.{cc,h} codes for better readability and to prepare for the next patch.
  3. Implement the patch plan without channel roaming, the patch will modify:
    • Wi-Fi docs (wifi-design.rst) with update for behavioral change.
    • sta-wifi-mac.{cc,h} for better handing of REFUSED state: Add list of potential APs from active/passive scan, STA will first try to associate with the AP with best SNR. If failed, then try the next best AP. Only go to REFUSED state when the list is exhausted.
    • Add two unit tests to test the new event handling.

The patch plan has been updated accordingly [3]. Currently, the fix on MissedBeacon handling is pushed for another patch if there is time left on the project.

Week 2 (May 21st-May 27th)

Tasks Completed:

  • Implemented a sequence of 3 patches to resolve bug 2399 [4]:
    1. Updating Wifi documentations to better reflect the current state of infrastructure association on StaWifiMac.
    2. Refactor part of Receive function on StaWifiMac for better readability and to prepare for patch #3.
    3. Improve scanning capability and infrastructure association procedure on StaWifiMac, accompanied with its unit tests.
  • Discussed the patches with mentor and received approval.
  • Posted the patches on bugzilla for community's review [5].


We have improved the scanning procedure of StaWifiMac as follows:

  • Added a scanning state to gather beacons or probe responses. So rather than STA associating to the first beacon/probe response received, it will wait for an amount of time, then associate to the best AP (i.e., the best beacon/probe resp SNR).
  • If the best AP refused STA's association request, STA will try to associate to the next best AP until the list of candidate AP exhausted, if this occur STA will finally go to REFUSED state. Note that we cannot test this behavior since ns-3 haven't implement explicit association refusal from AP.

The patches for the improvements have been given go-ahead by mentor and posted to the bug tracker for community's approval. For the next week, we plan to resolve bug 2470.

Week 3 (May 28th-June 4th)

Tasks Completed:

  • Planned approaches to resolve bug 2470 with mentor.
  • Moved FileTransferApplication from previous works to the experimental branch.
  • Bug 2470: Implemented a regression test to test the response on ADDBA request fail [6].
  • Implemented ErrorModel to WifiPhy as a part of regression test.


To resolve bug 2470, we first implement a regression test to test the device's response when ADDBA request fails. The test involves a simple AP-STA setup with AP as the originator. After STA has associated, AP will try to send a burst of packets and establish BA agreement by sending ADDBA request packet. Using ErrorModel, we marked the ADDBA packet to always drop on recipient. The results is as follows:

  • ADDBA packets does considered as a DATA packet and needs ACK for successful transmission.
  • When missing ACK, ADDBA packet will be retransmitted until MaxSlrc.
  • If MaxSlrc exceeded, the originator stops the whole transmission attempt and the rest of the packets are lost.

From the regression test, we can be confident to say that ADDBA packets are retransmitted on failure following the standard. Yet the lost packets may not be an intended behavior, and we are currently gathering information on how real devices handled this case.

Week 4 (June 5th-June 11th)

Tasks Completed:

  • Merged the solution to bug 2399 to upstream.
  • Proposed solution to bug 2470.
  • Discovered an issue on the usage of SSRC and SLRC that is not aligned to the standard. A bug report has been submitted [7].
  • Discovered a failing Wifi test suite on commit 13643, and found out that it is unrelated to the bug 2399's patch, rather it is caused by unprotected RNG stream of other test in the suite.
  • Imported coexistence module from ns-3-lbt with disabled LTE support [8].


This week we are finalizing the the first phase of the LTE-Wifi Coexistence Module. First, a solution to bug 2470 is proposed: on fail BA agreement, Mac Low layer should notify Mac High layer to resend the packets using normal MPDU. It is pending community's approval.

Secondly, we imported previous coexistence module codes from ns-3-lbt with modifications such that an experiment consisted of entirely Wifi cells can be run. This involves stubbing out part of the code related to LTE.

First Phase Evaluations

As previously planned, we finalized the Wifi module to prepare for the coexistence module. We pushed patch for bug 2399 to upstream and planned for bug 2470. We also successfully imported old coexistence codes to the latest commit. The imported codes stub out codes that related to LTE thus currently only works with Wifi cell. A script to run a Wifi-Wifi simple experiment is implemented to confirm that the module works and outputs logs correctly.