Skip to content

Commit a89594e

Browse files
Francisco WilhelmiFrancisco Wilhelmi
authored andcommitted
Changes on the SR implementation. This version has been verified against Komondor v3.0 (https://github.com/wn-upf/Komondor/releases/tag/v3.0). An example is provided for an initial execution.
1 parent 1401676 commit a89594e

43 files changed

Lines changed: 831 additions & 844 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

console_logs.txt

Lines changed: 0 additions & 573 deletions
This file was deleted.

constants.mat

-7.86 KB
Binary file not shown.

source/SIMULATION_EXAMPLE.m

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
%%% ***********************************************************************
2+
%%% * *
3+
%%% * Spatial Reuse Operation in IEEE 802.11ax: *
4+
%%% * Analysis, Challenges and Research Opportunities *
5+
%%% * *
6+
%%% * Submission to IEEE Surveys & Tutorials *
7+
%%% * *
8+
%%% * Authors: *
9+
%%% * - Francesc Wilhelmi (francisco.wilhelmi@upf.edu) *
10+
%%% * - Sergio Barrachina-Muñoz (sergio.barrachina@upf.edu) *
11+
%%% * - Boris Bellalta (boris.bellalta@upf.edu) *
12+
%%% * - Cristina Cano (ccanobs@uoc.edu) *
13+
%%% * - Ioannis Selinis (ioannis.selinis@surrey.ac.uk) *
14+
%%% * *
15+
%%% * Copyright (C) 2019-2024, and GNU GPLd, by Francesc Wilhelmi *
16+
%%% * *
17+
%%% * Repository: *
18+
%%% * https://github.com/fwilhelmi/tutorial_11ax_spatial_reuse *
19+
%%% ***********************************************************************
20+
21+
%% PART 1 - Generate the data
22+
clear
23+
clc
24+
25+
% Generate constants
26+
constants_sfctmn_framework
27+
% Set specific configurations
28+
configuration_system
29+
30+
% Generate wlans object according to the input file
31+
input_file = 'input_example_spatial_reuse.csv';
32+
wlans = generate_wlan_from_file(input_file, false, false, 1, [], []);
33+
34+
% Compute the throughput of the scenario, for each OBSS_PD value
35+
disp('---------------------------')
36+
disp([' OBSS/PD (WLAN A) = -78 dBm / Tx Power (WLAN A) = 20 dBm'])
37+
disp('---------------------------')
38+
% Set the OBSS_PD to be used by WLAN A
39+
wlans(1).non_srg_obss_pd = -78;
40+
% Call the SFCTMN framework
41+
[throughput] = function_main_sfctmn(wlans);
42+
disp(['Throughput WLAN A in Test scenario: ' num2str(throughput(1))])
43+
disp(['Throughput WLAN B in Test scenario: ' num2str(throughput(2))])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
% code; primary; left ch; right ch; tx_power; cca; lambda; x_ap; y_ap; z_ap; x_sta; y_sta; z_sta; legacy_node; cw;non_srg_activated;srg;non_srg_obss_pd;srg_obss_pd;tx_pwr_ref
2+
1;1;1;1;20;-82;14815;0;4;0;0;0;0;0;512;1;0;-80;-75;21
3+
2;1;1;1;20;-82;14815;6;4;0;6;8;0;0;512;0;0;-80;-75;21

source/sfctm/MatlabSim11ax/PHYParams80211ax.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
% Header ------
55

6-
load('constants.mat');
6+
load('constants_sfctmn_framework.mat');
77

88
% Physical Header (HE SU Format)
99
Legacy_PHYH = 20E-6;
@@ -25,11 +25,9 @@
2525
case 80
2626
Nsc = 980;
2727
case 160
28-
Nsc = 1960;
29-
28+
Nsc = 1960;
3029
otherwise
31-
Nsc = -1;
32-
30+
Nsc = -1;
3331
end
3432

3533
% Modulation and Coding Scheme (MCS) - Without DCM!!!
@@ -77,5 +75,5 @@
7775
Yc = -1;
7876
end
7977
% Duration of OFDM symbol (CP of 3.2us is included)
80-
T_OFDM = 16E-6;
78+
T_OFDM = 4E-6;
8179
end

source/sfctm/MatlabSim11ax/SUtransmission80211ax.m

Lines changed: 63 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,68 @@
1010

1111
% RTS + SIFS + CTS + DATA + SIFS + ACK + DIFS + Te
1212

13-
function [T,T_c]=SUtransmission80211ax(L,Na,W,SUSS,MCSindex)
14-
15-
% Load 802.11ax parameters
16-
17-
%% MAC
18-
[DIFS,SIFS,Te,L_MACH,L_BACK,L_RTS,L_CTS,L_SF,L_DEL,L_TAIL]=MACParams80211ax();
19-
20-
%% PHY
21-
[Nsc,Ym,Yc,T_OFDM,Legacy_PHYH,HE_PHYH]=PHYParams80211ax(W,MCSindex,SUSS);
22-
23-
Rate = Nsc * Ym * Yc * SUSS;
24-
Rate_20MHz = 52 * Ym * Yc; % In legacy mode
25-
26-
%disp([Nsc Ym Yc]);
27-
28-
% Duplicate RTS/CTS for bandwidth allocation
29-
T_RTS = Legacy_PHYH + ceil((L_SF+L_RTS+L_TAIL)/Rate_20MHz)*T_OFDM;
30-
T_CTS = Legacy_PHYH + ceil((L_SF+L_CTS+L_TAIL)/Rate_20MHz)*T_OFDM;
31-
32-
% After successful acquisition of the channel
33-
T_DATA = (Legacy_PHYH + HE_PHYH) + ceil((L_SF+Na*(L_DEL+L_MACH+L)+L_TAIL)/Rate)*T_OFDM;
34-
T_BACK = Legacy_PHYH + ceil((L_SF+L_BACK+L_TAIL)/Rate_20MHz)*T_OFDM;
35-
36-
% Successful slot
37-
T = T_RTS + SIFS + T_CTS + SIFS + T_DATA + SIFS + T_BACK + DIFS + Te; % (Implicit BACK request)
38-
39-
% Collision slot
40-
T_c = T_RTS + SIFS + T_CTS + DIFS + Te;
13+
function [T, limited_num_packets_aggregated, T_c]=SUtransmission80211ax(L,Na,W,SUSS,MCSindex,TimeoutFlag)
4114

15+
16+
17+
if MCSindex == -1
18+
19+
T = 0;
20+
limited_num_packets_aggregated = 0;
21+
T_c = 0;
22+
23+
else
24+
25+
% Load 802.11ax parameters
26+
IEEE_AX_PHY_HE_SU_DURATION = 100e-6;
27+
IEEE_AX_MD_LENGTH = 32;
28+
IEEE_AX_MH_LENGTH = 320;
29+
IEEE_AX_OFDM_SYMBOL_GI32_DURATION = 16e-6;
30+
IEEE_AX_MAX_PPDU_DURATION = 5484e-6;
31+
32+
%% MAC
33+
[DIFS,SIFS,Te,L_MACH,L_BACK,L_RTS,L_CTS,L_SF,L_DEL,L_TAIL]=MACParams80211ax();
34+
35+
%% PHY
36+
[Nsc,Ym,Yc,T_OFDM,Legacy_PHYH,HE_PHYH]=PHYParams80211ax(W,MCSindex,SUSS);
37+
bits_ofdm_sym_legacy = 24;
38+
bits_ofdm_sym = Nsc * Ym * Yc * SUSS;
39+
% Rate = Nsc * Ym * Yc * SUSS;
40+
% Rate_20MHz = 52 * Ym * Yc; % In legacy mode
41+
42+
%disp([Nsc Ym Yc]);
43+
44+
% Duplicate RTS/CTS for bandwidth allocation
45+
T_RTS = Legacy_PHYH + ceil((L_SF+L_RTS)/bits_ofdm_sym_legacy)*T_OFDM;
46+
T_CTS = Legacy_PHYH + ceil((L_SF+L_CTS)/bits_ofdm_sym_legacy)*T_OFDM;
47+
48+
if(TimeoutFlag)
49+
T = T_RTS + DIFS;
50+
else
51+
% LIMIT OF THE NUMBER OF AGG PACKETS
52+
limited_num_packets_aggregated = Na;
53+
while (limited_num_packets_aggregated > 0)
54+
T_DATA = IEEE_AX_PHY_HE_SU_DURATION + ceil((L_SF + limited_num_packets_aggregated ...
55+
* (IEEE_AX_MD_LENGTH + IEEE_AX_MH_LENGTH + L)) / bits_ofdm_sym) * IEEE_AX_OFDM_SYMBOL_GI32_DURATION;
56+
if(T_DATA <= IEEE_AX_MAX_PPDU_DURATION)
57+
break;
58+
else
59+
limited_num_packets_aggregated = limited_num_packets_aggregated - 1;
60+
end
61+
end
62+
% After successful acquisition of the channel
63+
% T_DATA = IEEE_AX_PHY_HE_SU_DURATION + ceil((L_SF + limited_num_packets_aggregated * ...
64+
% (IEEE_AX_MD_LENGTH + IEEE_AX_MH_LENGTH + L)) / bits_ofdm_sym) * IEEE_AX_OFDM_SYMBOL_GI32_DURATION;
65+
66+
T_BACK = 32e-6;%Legacy_PHYH + ceil((L_SF+L_BACK+L_TAIL)/Rate_20MHz)*T_OFDM;
67+
68+
% Successful slot
69+
T = T_RTS + SIFS + T_CTS + SIFS + T_DATA + SIFS + T_BACK + DIFS + Te; % (Implicit BACK request)
70+
71+
% Collision slot
72+
T_c = T_RTS + SIFS + T_CTS + DIFS + Te;
73+
end
74+
75+
end
76+
4277
end

source/sfctm/apply_power_restriction.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
% Output:
1515
% -
1616

17-
load('constants.mat'); % Load constants into workspace
17+
load('constants_sfctmn_framework.mat'); % Load constants into workspace
1818
%load('configuration_system.mat'); % Load constants into workspace
1919

2020
limited_tx_power = zeros (1, size(cca_values, 2));

source/sfctm/arrow.m

100755100644
File mode changed.

source/sfctm/check_input_config.m

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
% Output:
1313
% - is_config_ok: (deprecated) boolean for identifying if configuration is properly entered.
1414

15-
load('constants.mat'); % Load constants into workspace
15+
load('constants_sfctmn_framework.mat'); % Load constants into workspace
1616

1717
is_config_ok = true;
1818

source/sfctm/compute_mcs.m

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function mcs_per_wlan = compute_mcs(power_from_ap_cell, num_channels_system)
1+
function mcs_per_wlan = compute_mcs(PSI_cell, power_from_ap_cell, num_channels_system)
22
% MCS_PER_WLAN computes the allowed Modulation Coding Scheme for each WLAN
33
% transmitting in different number of channels
44
% INPUT:
@@ -8,52 +8,50 @@
88
% * mcs_per_wlan: MCS in each WLAN for each number of channels used for tx
99
% (rows: number of channels, columns: MCS index)
1010

11-
load('constants.mat'); % Load constants into workspace
11+
load('constants_sfctmn_framework.mat'); % Load constants into workspace
1212

13-
mcs_per_wlan = {};
13+
mcs_per_wlan = cell(1, size(power_from_ap_cell, 2));
1414

15-
for state_ix = 1 : size(power_from_ap_cell, 2)
16-
15+
for state_ix = 1 : size(power_from_ap_cell, 2)
1716
power_state_ix = power_from_ap_cell{state_ix};
1817
num_wlans = size(power_from_ap_cell{state_ix}, 1);
19-
mcs_per_wlan{state_ix} = zeros(num_wlans, num_channels_system);
20-
18+
mcs_per_wlan{state_ix} = zeros(num_wlans, num_channels_system);
2119
for wlan_ix = 1 : num_wlans
22-
23-
for ch_ix = 1 : num_channels_system%(log2(num_channels_system) + 1) % For 1, 2, 4 and 8 channels
24-
25-
if power_state_ix(wlan_ix,ch_ix) < -82 +((ch_ix-1)*3)
20+
for ch_ix = 1 : num_channels_system %(log2(num_channels_system) + 1) % For 1, 2, 4 and 8 channels
21+
if PSI_cell{state_ix}(wlan_ix) > 0
22+
if power_state_ix(wlan_ix,ch_ix) < -82 +((ch_ix-1)*3)
23+
%mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_FORBIDDEN;
24+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_BPSK_1_2; % Default MCS (to always start the TX)
25+
elseif (power_state_ix(wlan_ix,ch_ix) >= -82 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -79 +((ch_ix-1)*3))
26+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_BPSK_1_2;
27+
elseif (power_state_ix(wlan_ix,ch_ix) >= -79 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -77 +((ch_ix-1)*3))
28+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_QPSK_1_2;
29+
elseif (power_state_ix(wlan_ix,ch_ix) >= -77 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -74 +((ch_ix-1)*3))
30+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_QPSK_3_4;
31+
elseif (power_state_ix(wlan_ix,ch_ix) >= -74 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -70 +((ch_ix-1)*3))
32+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_16QAM_1_2;
33+
elseif (power_state_ix(wlan_ix,ch_ix) >= -70 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -66 +((ch_ix-1)*3))
34+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_16QAM_3_4;
35+
elseif (power_state_ix(wlan_ix,ch_ix) >= -66 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -65 +((ch_ix-1)*3))
36+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_2_3;
37+
elseif (power_state_ix(wlan_ix,ch_ix) >= -65 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -64 +((ch_ix-1)*3))
38+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_3_4;
39+
elseif (power_state_ix(wlan_ix,ch_ix) >= -64 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -59 +((ch_ix-1)*3))
40+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_5_6;
41+
elseif (power_state_ix(wlan_ix,ch_ix) >= -59 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -57 +((ch_ix-1)*3))
42+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_256QAM_3_4;
43+
elseif (power_state_ix(wlan_ix,ch_ix) >= -57 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -54 +((ch_ix-1)*3))
44+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_256QAM_5_6;
45+
elseif (power_state_ix(wlan_ix,ch_ix) >= -54 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -52 +((ch_ix-1)*3))
46+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_1024QAM_3_4;
47+
else
48+
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_1024QAM_5_6;
49+
end
50+
else % If the WLAN is not transmitting in state "state_ix"
2651
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_FORBIDDEN;
27-
elseif (power_state_ix(wlan_ix,ch_ix) >= -82 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -79 +((ch_ix-1)*3))
28-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_BPSK_1_2;
29-
elseif (power_state_ix(wlan_ix,ch_ix) >= -79 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -77 +((ch_ix-1)*3))
30-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_QPSK_1_2;
31-
elseif (power_state_ix(wlan_ix,ch_ix) >= -77 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -74 +((ch_ix-1)*3))
32-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_QPSK_3_4;
33-
elseif (power_state_ix(wlan_ix,ch_ix) >= -74 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -70 +((ch_ix-1)*3))
34-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_16QAM_1_2;
35-
elseif (power_state_ix(wlan_ix,ch_ix) >= -70 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -66 +((ch_ix-1)*3))
36-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_16QAM_3_4;
37-
elseif (power_state_ix(wlan_ix,ch_ix) >= -66 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -65 +((ch_ix-1)*3))
38-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_2_3;
39-
elseif (power_state_ix(wlan_ix,ch_ix) >= -65 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -64 +((ch_ix-1)*3))
40-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_3_4;
41-
elseif (power_state_ix(wlan_ix,ch_ix) >= -64 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -59 +((ch_ix-1)*3))
42-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_64QAM_5_6;
43-
elseif (power_state_ix(wlan_ix,ch_ix) >= -59 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -57 +((ch_ix-1)*3))
44-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_256QAM_3_4;
45-
elseif (power_state_ix(wlan_ix,ch_ix) >= -57 + ((ch_ix-1)*3) && power_state_ix(wlan_ix,ch_ix) < -54 +((ch_ix-1)*3))
46-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_256QAM_5_6;
47-
elseif (power_state_ix(wlan_ix,ch_ix) >= -54 + (ch_ix*3) && power_state_ix(wlan_ix,ch_ix) < -52 +(ch_ix*3))
48-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_1024QAM_3_4;
49-
else
50-
mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_1024QAM_5_6;
5152
end
52-
53-
end
54-
55-
end
56-
53+
end
54+
end
5755
end
5856

5957
end

0 commit comments

Comments
 (0)