Bug 2629

Summary: Assert failure in MinstrelHtWifiManager::GetLowestIndex
Product: ns-3 Reporter: sebastien.deronne
Component: wifiAssignee: Matías Richart <matis18>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P3    
Version: ns-3.26   
Hardware: All   
OS: All   
Attachments: script to reproduce the issue
Patch to solve the issue.
Patch to solve the issue v2
new proposed solution: fill in supported rates once beacon is received

Description sebastien.deronne 2017-01-21 04:34:01 UTC
Created attachment 2754 [details]
script to reproduce the issue

Issue was reported by William Dieter on the forum:
https://groups.google.com/forum/#!topic/ns-3-users/3Kb7bTGar7g

When we run the attached script with Ideal wifi manager, it works fine.
When we use Minstrel HT wifi manager, it hits the following assert:

assert failed. cond="station->m_groupsTable[groupId].m_supported && station->m_groupsTable[groupId].m_ratesTable[rateId].supported", file=../src/wifi/model/minstrel-ht-wifi-manager.cc, line=1857
libc++abi.dylib: terminating
Comment 1 sebastien.deronne 2017-01-21 04:34:26 UTC
Matias, could you have a look?
Comment 2 Matías Richart 2017-01-23 15:25:03 UTC
The problem appears because the remote station supports VHT but there is no VHT MCS supported.

There is always a default MCS supported but it is a HT (non VHT) MCS.

The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
because the remote station is set to support VHT but supported MCSs are not initialized.

I attach a patch for minstrelHt that solves the issue.
But, is it ok to have a remote station marked as vht supported but with no mcs available?
Comment 3 Matías Richart 2017-01-23 15:26:18 UTC
Created attachment 2758 [details]
Patch to solve the issue.

Mark a group as supported only if there is at least one MCS supported inside the group.
Comment 4 sebastien.deronne 2017-01-23 15:28:36 UTC
(In reply to Matías Richart from comment #2)
> The problem appears because the remote station supports VHT but there is no
> VHT MCS supported.
> 
> There is always a default MCS supported but it is a HT (non VHT) MCS.
> 
> The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> because the remote station is set to support VHT but supported MCSs are not
> initialized.
> 
> I attach a patch for minstrelHt that solves the issue.
> But, is it ok to have a remote station marked as vht supported but with no
> mcs available?

I do not understand, how can this have no VHT MCS supported?
The user configure the nodes to be VHT machines running Minstrel HT, so I do not see anything wrong in the configuration itself.
Comment 5 Matías Richart 2017-01-23 15:50:18 UTC
Sorry, but previous proposal generates another issue.
It makes possible that no group (and so no MCS) is available and minstrel needs at least one MCS supported to work properly.

I propose another patch to select an HT MCS when VHT is supported but only 1 MCS is available.
This solution works assuming that there is always one default HT MCS.

I'll test more extensibly the proposal but I think it works.
Comment 6 Matías Richart 2017-01-23 15:50:49 UTC
Created attachment 2759 [details]
Patch to solve the issue v2
Comment 7 Matías Richart 2017-01-23 15:57:36 UTC
(In reply to sebastien.deronne from comment #4)
> (In reply to Matías Richart from comment #2)
> > The problem appears because the remote station supports VHT but there is no
> > VHT MCS supported.
> > 
> > There is always a default MCS supported but it is a HT (non VHT) MCS.
> > 
> > The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> > because the remote station is set to support VHT but supported MCSs are not
> > initialized.
> > 
> > I attach a patch for minstrelHt that solves the issue.
> > But, is it ok to have a remote station marked as vht supported but with no
> > mcs available?
> 
> I do not understand, how can this have no VHT MCS supported?
> The user configure the nodes to be VHT machines running Minstrel HT, so I do
> not see anything wrong in the configuration itself.

It is not an issue of configuration.
In this example, minstrel is called before association is finished and then m_operationalMcsSet in remoteWifiManager is not filled yet.
For this cases a default MCS is used, which is pushed when WifiRemoteStationState is created.
But this default MCS is an HT MCS. When misntrel looks for a VHT MCS does not find any.
Comment 8 sebastien.deronne 2017-01-23 16:15:09 UTC
(In reply to Matías Richart from comment #7)
> (In reply to sebastien.deronne from comment #4)
> > (In reply to Matías Richart from comment #2)
> > > The problem appears because the remote station supports VHT but there is no
> > > VHT MCS supported.
> > > 
> > > There is always a default MCS supported but it is a HT (non VHT) MCS.
> > > 
> > > The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> > > because the remote station is set to support VHT but supported MCSs are not
> > > initialized.
> > > 
> > > I attach a patch for minstrelHt that solves the issue.
> > > But, is it ok to have a remote station marked as vht supported but with no
> > > mcs available?
> > 
> > I do not understand, how can this have no VHT MCS supported?
> > The user configure the nodes to be VHT machines running Minstrel HT, so I do
> > not see anything wrong in the configuration itself.
> 
> It is not an issue of configuration.
> In this example, minstrel is called before association is finished and then
> m_operationalMcsSet in remoteWifiManager is not filled yet.
> For this cases a default MCS is used, which is pushed when
> WifiRemoteStationState is created.
> But this default MCS is an HT MCS. When misntrel looks for a VHT MCS does
> not find any.

Can't we envision to have a VHT MCS as default if VHT is supported?
Since this is quite default configuration, why is the issue only seen in this scenario?
Comment 9 Matías Richart 2017-01-24 10:41:58 UTC
(In reply to sebastien.deronne from comment #8)
> (In reply to Matías Richart from comment #7)
> > (In reply to sebastien.deronne from comment #4)
> > > (In reply to Matías Richart from comment #2)
> > > > The problem appears because the remote station supports VHT but there is no
> > > > VHT MCS supported.
> > > > 
> > > > There is always a default MCS supported but it is a HT (non VHT) MCS.
> > > > 
> > > > The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> > > > because the remote station is set to support VHT but supported MCSs are not
> > > > initialized.
> > > > 
> > > > I attach a patch for minstrelHt that solves the issue.
> > > > But, is it ok to have a remote station marked as vht supported but with no
> > > > mcs available?
> > > 
> > > I do not understand, how can this have no VHT MCS supported?
> > > The user configure the nodes to be VHT machines running Minstrel HT, so I do
> > > not see anything wrong in the configuration itself.
> > 
> > It is not an issue of configuration.
> > In this example, minstrel is called before association is finished and then
> > m_operationalMcsSet in remoteWifiManager is not filled yet.
> > For this cases a default MCS is used, which is pushed when
> > WifiRemoteStationState is created.
> > But this default MCS is an HT MCS. When misntrel looks for a VHT MCS does
> > not find any.
> 
> Can't we envision to have a VHT MCS as default if VHT is supported?

I think we can. I'll check if the standard say something about default rates when VHT is supported.

> Since this is quite default configuration, why is the issue only seen in
> this scenario?

It is also seen in rate-adaptation-distance example if you change the standard to ac. But it does not happen in minstrel-ht-wifi-manager-example because it uses adhoc mode.
Comment 10 sebastien.deronne 2017-01-24 10:51:53 UTC
(In reply to Matías Richart from comment #9)
> (In reply to sebastien.deronne from comment #8)
> > (In reply to Matías Richart from comment #7)
> > > (In reply to sebastien.deronne from comment #4)
> > > > (In reply to Matías Richart from comment #2)
> > > > > The problem appears because the remote station supports VHT but there is no
> > > > > VHT MCS supported.
> > > > > 
> > > > > There is always a default MCS supported but it is a HT (non VHT) MCS.
> > > > > 
> > > > > The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> > > > > because the remote station is set to support VHT but supported MCSs are not
> > > > > initialized.
> > > > > 
> > > > > I attach a patch for minstrelHt that solves the issue.
> > > > > But, is it ok to have a remote station marked as vht supported but with no
> > > > > mcs available?
> > > > 
> > > > I do not understand, how can this have no VHT MCS supported?
> > > > The user configure the nodes to be VHT machines running Minstrel HT, so I do
> > > > not see anything wrong in the configuration itself.
> > > 
> > > It is not an issue of configuration.
> > > In this example, minstrel is called before association is finished and then
> > > m_operationalMcsSet in remoteWifiManager is not filled yet.
> > > For this cases a default MCS is used, which is pushed when
> > > WifiRemoteStationState is created.
> > > But this default MCS is an HT MCS. When misntrel looks for a VHT MCS does
> > > not find any.
> > 
> > Can't we envision to have a VHT MCS as default if VHT is supported?
> 
> I think we can. I'll check if the standard say something about default rates
> when VHT is supported.
> 
> > Since this is quite default configuration, why is the issue only seen in
> > this scenario?
> 
> It is also seen in rate-adaptation-distance example if you change the
> standard to ac. But it does not happen in minstrel-ht-wifi-manager-example
> because it uses adhoc mode.

Then I think regression should be extended in order cover this case.
Comment 11 Matías Richart 2017-01-25 11:08:37 UTC
(In reply to sebastien.deronne from comment #10)
> (In reply to Matías Richart from comment #9)
> > (In reply to sebastien.deronne from comment #8)
> > > (In reply to Matías Richart from comment #7)
> > > > (In reply to sebastien.deronne from comment #4)
> > > > > (In reply to Matías Richart from comment #2)
> > > > > > The problem appears because the remote station supports VHT but there is no
> > > > > > VHT MCS supported.
> > > > > > 
> > > > > > There is always a default MCS supported but it is a HT (non VHT) MCS.
> > > > > > 
> > > > > > The problem appears after fixes for bug 2532 (changeset 12385:54003ae0e2d4)
> > > > > > because the remote station is set to support VHT but supported MCSs are not
> > > > > > initialized.
> > > > > > 
> > > > > > I attach a patch for minstrelHt that solves the issue.
> > > > > > But, is it ok to have a remote station marked as vht supported but with no
> > > > > > mcs available?
> > > > > 
> > > > > I do not understand, how can this have no VHT MCS supported?
> > > > > The user configure the nodes to be VHT machines running Minstrel HT, so I do
> > > > > not see anything wrong in the configuration itself.
> > > > 
> > > > It is not an issue of configuration.
> > > > In this example, minstrel is called before association is finished and then
> > > > m_operationalMcsSet in remoteWifiManager is not filled yet.
> > > > For this cases a default MCS is used, which is pushed when
> > > > WifiRemoteStationState is created.
> > > > But this default MCS is an HT MCS. When misntrel looks for a VHT MCS does
> > > > not find any.
> > > 
> > > Can't we envision to have a VHT MCS as default if VHT is supported?
> > 
> > I think we can. I'll check if the standard say something about default rates
> > when VHT is supported.
> > 
> > > Since this is quite default configuration, why is the issue only seen in
> > > this scenario?
> > 
> > It is also seen in rate-adaptation-distance example if you change the
> > standard to ac. But it does not happen in minstrel-ht-wifi-manager-example
> > because it uses adhoc mode.
> 
> Then I think regression should be extended in order cover this case.

I agree.

Regarding which rate should we use I found this in the standard (Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications Amendment 4: Enhancements for Very High Throughput for Operation in Bands below 6 GHz):

Change the last paragraph of 9.7.5.3 as follows:
If the BSSBasicRateSet parameter, the BSSBasicMCSSet parameter, and the BSS basic VHT-MCS and NSS set are empty (e.g., a scanning STA that is not yet associated with a BSS), the frame shall be transmitted in a non-HT PPDU using one of the mandatory PHY rates.

I think we are in this case. What do you think?
Comment 12 sebastien.deronne 2017-01-25 14:11:50 UTC
Indeed, and I guess the same applies for HT?
Comment 13 Matías Richart 2017-01-26 10:21:59 UTC
I'll summarize my findings:

The bug reported here is generated because a STA which supports VHT wants to transmit an Association Request to an AP which also supports VHT.
MinstrelHt tries to send the frame with a VHT-MCS but does not found any VHT-MCS in the operationalMcsSet and fails.

According to the standard if all rate sets (rate, ht and vht) are empty, the STA shall use a "mandatory PHY rate".

Here I found 2 issues.

- In NS3, the basicRateSet and the basicMcsSet are never empty because at initialization a "default rate" is pushed. It is not clear to me if this is correct and the implications of changing it.

- However, in this case I think the sets shouldn't be empty. They should be filled with the supported rates received in the Beacon. The same way that it is done when we receive a probe response. Do you agree?
Comment 14 sebastien.deronne 2017-01-27 16:50:19 UTC
(In reply to Matías Richart from comment #13)
> I'll summarize my findings:
> 
> The bug reported here is generated because a STA which supports VHT wants to
> transmit an Association Request to an AP which also supports VHT.
> MinstrelHt tries to send the frame with a VHT-MCS but does not found any
> VHT-MCS in the operationalMcsSet and fails.
> 
> According to the standard if all rate sets (rate, ht and vht) are empty, the
> STA shall use a "mandatory PHY rate".
> 
> Here I found 2 issues.
> 
> - In NS3, the basicRateSet and the basicMcsSet are never empty because at
> initialization a "default rate" is pushed. It is not clear to me if this is
> correct and the implications of changing it.

No idea, I saw some bugs in the past if this is not present so I would keep it for now.

> 
> - However, in this case I think the sets shouldn't be empty. They should be
> filled with the supported rates received in the Beacon. The same way that it
> is done when we receive a probe response. Do you agree?

Yes, it sounds incorrect that we do not fill supported modes upon beacon reception.
Comment 15 sebastien.deronne 2017-01-30 09:05:06 UTC
Created attachment 2768 [details]
new proposed solution: fill in supported rates once beacon is received

Based on previous discussions, I prepared a new patch that fills in supported rates once beacon is received. Matias, do you agree with this (possibly) final patch?
Comment 16 Matías Richart 2017-01-30 14:56:32 UTC
(In reply to sebastien.deronne from comment #15)
> Created attachment 2768 [details]
> new proposed solution: fill in supported rates once beacon is received
> 
> Based on previous discussions, I prepared a new patch that fills in
> supported rates once beacon is received. Matias, do you agree with this
> (possibly) final patch?

I agree
Comment 17 sebastien.deronne 2017-01-30 15:12:55 UTC
Fixed in changeset 12594:8076e0b00253