Bug 2771

Summary: Simulation fails with IdealWifiManager if stations have different number of antennas
Product: ns-3 Reporter: Akin Soysal <akinsoysal>
Component: wifiAssignee: sebastien.deronne
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tomh
Priority: P3    
Version: ns-3.26   
Hardware: All   
OS: All   
Attachments: Bugfix Patch ns-3.26
Ideal Wifi patch
test script
proposed solution

Description Akin Soysal 2017-08-08 03:32:38 UTC
Created attachment 2896 [details]
Bugfix Patch ns-3.26

Hello,

In IdealWifiManager, since beamforming is not implemented, SINR thresholds are identical for each of their MCS values. However, the IdealWifiManager should include the MCS value for the highest NSS value although the SINR thresholds are the same. The problem is in the "threshold > maxThreshold" check and it should be "threshold => maxThreshold" instead.

I have uploaded a proposed patch for it as attachment applied in ns-3.26.

Regards,
Akın
Comment 1 Akin Soysal 2017-08-08 03:49:29 UTC
Created attachment 2897 [details]
Ideal Wifi patch

First patch is wrong, please ignore it and take this into account.
Comment 2 Tom Henderson 2017-08-10 18:38:31 UTC
Could you please check against ns-3-dev?  IdealWifiManager was fixed (e.g. bug 2647) since the release of ns-3.26.
Comment 3 Akin Soysal 2017-08-11 02:50:36 UTC
I have checked in ns-3-dev, the problem is still there. I still see ">" instead of ">=". After hg blame, I see that it was last changed in changeset 12686 but even before that ">" sign was used.

changeset 12686:
https://code.nsnam.org/index.cgi/ns-3-dev/rev/503f88506643

This is also the commit for bug 2647 but I do not think that they thought that as the NSS increases, the threshold should change. But since beamforming is not included yet, higher NSS can also have the same SNR threshold.
Comment 4 sebastien.deronne 2017-09-13 13:41:19 UTC
It looks ok, but I would like the approval of Matias and Tom before pushing this to the mainstream.
Comment 5 Tom Henderson 2017-09-13 15:34:55 UTC
The patch is not against ns-3-dev; the code in ns-3-dev has changed in a way that I believe the problem is avoided.  It now says:

if (dataRate > bestRate && threshold < station->m_lastSnrObserved)

so if the nss yields a higher data rate, it should be selected.

Can you please check whether ns-3-dev exhibits a problem?
Comment 6 Akin Soysal 2017-09-19 03:24:34 UTC
Hello Tom,

With the attached script that I have, I get the following ASSERT now:

msg="Reception ends in failure because of an unsupported number of spatial streams", file=../src/wifi/model/wifi-phy.cc, line=2399
terminate called without an active exception


Arguments to run the script with:

./waf --run 'scratch/vht_network_from_omer --nWifiAp=1 --nWifiSta=2 --udp=1 --ideal=2 --nssAp=3 --nssSta1=2 --nssSta2=1 --speed=0.0 --simulationTime=10.0 --fading=0 --distance=5'
Comment 7 Akin Soysal 2017-09-19 03:24:55 UTC
Created attachment 2919 [details]
test script
Comment 8 Akin Soysal 2017-09-19 03:27:48 UTC
Sorry, this was for 2771, for IdealWifiManager run it with

./waf --run 'scratch/vht_network_from_omer --nWifiAp=1 --nWifiSta=2 --udp=1 --ideal=1 --nssAp=3 --nssSta1=2 --nssSta2=1 --speed=0.0 --simulationTime=10.0 --fading=0 --distance=5'

and you get this error

against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs3 nss 1 GI 800 width 20
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs3 nss 1 GI 800 width 40
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs3 nss 1 GI 800 width 80
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs4 nss 1 GI 800 width 20
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs4 nss 1 GI 800 width 40
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs4 nss 1 GI 800 width 80
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs5 nss 1 GI 800 width 20
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs5 nss 1 GI 800 width 40
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs5 nss 1 GI 800 width 80
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs6 nss 1 GI 800 width 20
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs6 nss 1 GI 800 width 40
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs6 nss 1 GI 800 width 80
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs7 nss 1 GI 800 width 20
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs7 nss 1 GI 800 width 40
against TxVector VhtMcs0 nss 2 GI 800 width 80
Checking HtMcs7 nss 1 GI 800 width 80
against TxVector VhtMcs0 nss 2 GI 800 width 80
assert failed. cond="false", file=../src/wifi/model/ideal-wifi-manager.cc, line=192
terminate called without an active exception


Indicating that none of the txVector is within none of the thresholds in IdealWifiManager::GetSnrThreshold.
Comment 9 sebastien.deronne 2017-09-20 17:33:31 UTC
Created attachment 2922 [details]
proposed solution

Tom or Matias, I think I have a fix for this but I let you have a further investigation.
Comment 10 Tom Henderson 2017-09-25 00:50:43 UTC
(In reply to sebastien.deronne from comment #9)
> Created attachment 2922 [details]
> proposed solution
> 
> Tom or Matias, I think I have a fix for this but I let you have a further
> investigation.

+1
Comment 11 Akin Soysal 2017-09-25 09:03:23 UTC
Proposed patch works for a 3 antenna STA together with a 2 antenna STA without any problem.
Comment 12 sebastien.deronne 2017-09-25 14:29:07 UTC
Fixed in changeset 13080:804d4eccdc7f