From b4f88cd33d75727dfbfdbf89231fee6c6b0029ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Mon, 12 Oct 2020 08:56:08 +0200 Subject: [PATCH] wifi: Add error rate tables --- src/wifi/model/reference/error-rate-tables.h | 221 +++++++++++++++++++ src/wifi/wscript | 1 + 2 files changed, 222 insertions(+) create mode 100644 src/wifi/model/reference/error-rate-tables.h diff --git a/src/wifi/model/reference/error-rate-tables.h b/src/wifi/model/reference/error-rate-tables.h new file mode 100644 index 000000000..070e9e4a4 --- /dev/null +++ b/src/wifi/model/reference/error-rate-tables.h @@ -0,0 +1,221 @@ +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2020 University of Washington + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Authors: Rohan Patidar + * Sébastien Deronne + * Sian Jin + */ + +#ifndef ERROR_RATE_TABLES_H +#define ERROR_RATE_TABLES_H + +namespace ns3 { + +const uint16_t ERROR_TABLE_SMALL_FRAME_SIZE = 32; +const uint16_t ERROR_TABLE_LARGE_FRAME_SIZE = 1458; +const uint8_t ERROR_TABLE_MAX_NUM_MCS = 9; + +static const std::vector > AwgnErrorTable32 [ERROR_TABLE_MAX_NUM_MCS + 1] = { + // MCS-0 + { + {-3.20000, 1.00000}, {-3.00000, 0.99751}, {-2.80000, 0.98526}, {-2.60000, 0.97805}, {-2.40000, 0.95933}, + {-2.20000, 0.90724}, {-2.00000, 0.87939}, {-1.80000, 0.73985}, {-1.60000, 0.63150}, {-1.40000, 0.57615}, + {-1.20000, 0.42980}, {-1.00000, 0.34749}, {-0.80000, 0.22253}, {-0.60000, 0.14667}, {-0.40000, 0.10149}, + {-0.20000, 0.06517}, {0.00000, 0.03774}, {0.20000, 0.02305}, {0.40000, 0.01258}, {0.60000, 0.00725}, + {0.80000, 0.00388}, {1.00000, 0.00220}, {1.20000, 0.00120}, {1.40000, 0.00042}, {1.60000, 0.00030}, + {1.80000, 0.00020}, {2.00000, 0.00007}, {2.20000, 0.00003}, {2.40000, 0.00000}, + }, + // MCS-1 + { + {-0.20000, 1.00000}, {0.00000, 0.99504}, {0.20000, 0.99504}, {0.40000, 0.98044}, {0.60000, 0.94799}, + {0.80000, 0.90519}, {1.00000, 0.84958}, {1.20000, 0.75518}, {1.40000, 0.66281}, {1.60000, 0.53113}, + {1.80000, 0.41128}, {2.00000, 0.29792}, {2.20000, 0.21889}, {2.40000, 0.15850}, {2.60000, 0.08589}, + {2.80000, 0.05338}, {3.00000, 0.03401}, {3.20000, 0.02251}, {3.40000, 0.01171}, {3.60000, 0.00653}, + {3.80000, 0.00340}, {4.00000, 0.00185}, {4.20000, 0.00080}, {4.40000, 0.00042}, {4.60000, 0.00015}, + {4.80000, 0.00005}, {5.00000, 0.00005}, {5.20000, 0.00000}, + }, + // MCS-2 + { + {2.80000, 1.00000}, {3.00000, 0.96394}, {3.20000, 0.94353}, {3.40000, 0.91553}, {3.60000, 0.81837}, + {3.80000, 0.71993}, {4.00000, 0.56879}, {4.20000, 0.50695}, {4.40000, 0.35644}, {4.60000, 0.28440}, + {4.80000, 0.18496}, {5.00000, 0.11938}, {5.20000, 0.08119}, {5.40000, 0.04399}, {5.60000, 0.02675}, + {5.80000, 0.01540}, {6.00000, 0.00822}, {6.20000, 0.00470}, {6.40000, 0.00205}, {6.60000, 0.00140}, + {6.80000, 0.00060}, {7.00000, 0.00038}, {7.20000, 0.00015}, {7.40000, 0.00011}, {7.60000, 0.00007}, + {7.80000, 0.00000}, + }, + // MCS-3 + { + {5.60000, 1.00000}, {5.80000, 0.99257}, {6.00000, 0.96860}, {6.20000, 0.95094}, {6.40000, 0.94353}, + {6.60000, 0.85138}, {6.80000, 0.78474}, {7.00000, 0.69019}, {7.20000, 0.56006}, {7.40000, 0.48547}, + {7.60000, 0.36257}, {7.80000, 0.25722}, {8.00000, 0.18471}, {8.20000, 0.12046}, {8.40000, 0.08022}, + {8.60000, 0.05137}, {8.80000, 0.03217}, {9.00000, 0.01752}, {9.20000, 0.01129}, {9.40000, 0.00613}, + {9.60000, 0.00350}, {9.80000, 0.00200}, {10.00000, 0.00083}, {10.20000, 0.00055}, {10.40000, 0.00028}, + {10.60000, 0.00005}, {10.80000, 0.00001}, {11.00000, 0.00000}, + }, + // MCS-4 + { + {8.40000, 1.00000}, {8.60000, 0.99930}, {8.80000, 0.98937}, {9.00000, 0.97814}, {9.20000, 0.96570}, + {9.40000, 0.91493}, {9.60000, 0.86559}, {9.80000, 0.83368}, {10.00000, 0.74157}, {10.20000, 0.64457}, + {10.40000, 0.56077}, {10.60000, 0.42837}, {10.80000, 0.31723}, {11.00000, 0.21704}, {11.20000, 0.15537}, + {11.40000, 0.10741}, {11.60000, 0.06370}, {11.80000, 0.04047}, {12.00000, 0.02421}, {12.20000, 0.01397}, + {12.40000, 0.00803}, {12.60000, 0.00444}, {12.80000, 0.00257}, {13.00000, 0.00139}, {13.20000, 0.00082}, + {13.40000, 0.00063}, {13.60000, 0.00034}, {13.80000, 0.00011}, {14.00000, 0.00005}, {14.20000, 0.00000}, + }, + // MCS-5 + { + {12.00000, 1.00000}, {12.20000, 0.99257}, {12.40000, 0.99012}, {12.60000, 0.95933}, {12.80000, 0.95933}, + {13.00000, 0.92396}, {13.20000, 0.86237}, {13.40000, 0.78937}, {13.60000, 0.72383}, {13.80000, 0.68547}, + {14.00000, 0.59673}, {14.20000, 0.46901}, {14.40000, 0.37095}, {14.60000, 0.29616}, {14.80000, 0.21594}, + {15.00000, 0.16150}, {15.20000, 0.12067}, {15.40000, 0.08217}, {15.60000, 0.05459}, {15.80000, 0.03878}, + {16.00000, 0.02268}, {16.20000, 0.01605}, {16.40000, 0.00933}, {16.60000, 0.00590}, {16.80000, 0.00355}, + {17.00000, 0.00248}, {17.20000, 0.00143}, {17.40000, 0.00077}, {17.60000, 0.00065}, {17.80000, 0.00035}, + {18.00000, 0.00025}, {18.20000, 0.00013}, {18.40000, 0.00009}, {18.60000, 0.00003}, {18.80000, 0.00000}, + }, + // MCS-6 + { + {13.40000, 1.00000}, {13.60000, 0.99257}, {13.80000, 0.99012}, {14.00000, 0.95704}, {14.20000, 0.94163}, + {14.40000, 0.93473}, {14.60000, 0.87174}, {14.80000, 0.80847}, {15.00000, 0.72777}, {15.20000, 0.62461}, + {15.40000, 0.57948}, {15.60000, 0.47232}, {15.80000, 0.34659}, {16.00000, 0.30402}, {16.20000, 0.20864}, + {16.40000, 0.16778}, {16.60000, 0.10941}, {16.80000, 0.07152}, {17.00000, 0.04993}, {17.20000, 0.03387}, + {17.40000, 0.02261}, {17.60000, 0.01324}, {17.80000, 0.00912}, {18.00000, 0.00515}, {18.20000, 0.00382}, + {18.40000, 0.00190}, {18.60000, 0.00088}, {18.80000, 0.00072}, {19.00000, 0.00045}, {19.20000, 0.00022}, + {19.40000, 0.00015}, {19.60000, 0.00007}, {19.80000, 0.00003}, {20.00000, 0.00000}, + }, + // MCS-7 + { + {14.80000, 1.00000}, {15.00000, 0.98768}, {15.20000, 0.97504}, {15.40000, 0.95476}, {15.60000, 0.94353}, + {15.80000, 0.91553}, {16.00000, 0.84067}, {16.20000, 0.76820}, {16.40000, 0.67282}, {16.60000, 0.57781}, + {16.80000, 0.52214}, {17.00000, 0.43921}, {17.20000, 0.32788}, {17.40000, 0.24347}, {17.60000, 0.19123}, + {17.80000, 0.12722}, {18.00000, 0.08600}, {18.20000, 0.05338}, {18.40000, 0.03655}, {18.60000, 0.02303}, + {18.80000, 0.01483}, {19.00000, 0.00890}, {19.20000, 0.00543}, {19.40000, 0.00335}, {19.60000, 0.00165}, + {19.80000, 0.00110}, {20.00000, 0.00065}, {20.20000, 0.00040}, {20.40000, 0.00032}, {20.60000, 0.00028}, + {20.80000, 0.00010}, {21.00000, 0.00007}, {21.20000, 0.00003}, {21.40000, 0.00000}, + }, + // MCS-8 + { + {19.80000, 1.00000}, {20.00000, 0.99012}, {20.20000, 0.96163}, {20.40000, 0.89709}, {20.60000, 0.85501}, + {20.80000, 0.78782}, {21.00000, 0.70475}, {21.20000, 0.59320}, {21.40000, 0.50062}, {21.60000, 0.37582}, + {21.80000, 0.29792}, {22.00000, 0.22707}, {22.20000, 0.17262}, {22.40000, 0.14036}, {22.60000, 0.09376}, + {22.80000, 0.06519}, {23.00000, 0.05036}, {23.20000, 0.03603}, {23.40000, 0.02608}, {23.60000, 0.02247}, + {23.80000, 0.01413}, {24.00000, 0.01113}, {24.20000, 0.00775}, {24.40000, 0.00580}, {24.60000, 0.00428}, + {24.80000, 0.00305}, {25.00000, 0.00290}, {25.20000, 0.00180}, {25.40000, 0.00097}, {25.60000, 0.00090}, + {25.80000, 0.00065}, {26.00000, 0.00032}, {26.20000, 0.00028}, {26.40000, 0.00020}, {26.60000, 0.00018}, + {26.80000, 0.00015}, {27.00000, 0.00000}, + }, + // MCS-9 + { + {21.60000, 1.00000}, {21.80000, 0.99751}, {22.00000, 0.98768}, {22.20000, 0.96163}, {22.40000, 0.93911}, + {22.60000, 0.86609}, {22.80000, 0.80040}, {23.00000, 0.66172}, {23.20000, 0.57368}, {23.40000, 0.47625}, + {23.60000, 0.34629}, {23.80000, 0.25428}, {24.00000, 0.18871}, {24.20000, 0.13644}, {24.40000, 0.10722}, + {24.60000, 0.08231}, {24.80000, 0.05274}, {25.00000, 0.03870}, {25.20000, 0.02931}, {25.40000, 0.02209}, + {25.60000, 0.01624}, {25.80000, 0.01290}, {26.00000, 0.00932}, {26.20000, 0.00653}, {26.40000, 0.00532}, + {26.60000, 0.00380}, {26.80000, 0.00313}, {27.00000, 0.00225}, {27.20000, 0.00153}, {27.40000, 0.00097}, + {27.60000, 0.00075}, {27.80000, 0.00057}, {28.00000, 0.00047}, {28.20000, 0.00032}, {28.40000, 0.00022}, + {28.60000, 0.00013}, {28.80000, 0.00007}, {29.00000, 0.00005}, {29.20000, 0.00000}, + }, +}; + +static const std::vector > AwgnErrorTable1458 [ERROR_TABLE_MAX_NUM_MCS + 1] = { + // MCS-0 + { + {-0.80000, 1.00000}, {-0.60000, 0.99751}, {-0.40000, 0.98284}, {-0.20000, 0.93473}, {0.00000, 0.77713}, + {0.20000, 0.61598}, {0.40000, 0.39391}, {0.60000, 0.23602}, {0.80000, 0.12170}, {1.00000, 0.06643}, + {1.20000, 0.03463}, {1.40000, 0.01655}, {1.60000, 0.00670}, {1.80000, 0.00343}, {2.00000, 0.00155}, + {2.20000, 0.00063}, {2.40000, 0.00032}, {2.60000, 0.00018}, {2.80000, 0.00005}, {3.00000, 0.00000}, + }, + // MCS-1 + { + {2.40000, 1.00000}, {2.60000, 0.99504}, {2.80000, 0.93911}, {3.00000, 0.80847}, {3.20000, 0.60850}, + {3.40000, 0.41255}, {3.60000, 0.23700}, {3.80000, 0.12812}, {4.00000, 0.07167}, {4.20000, 0.03566}, + {4.40000, 0.01664}, {4.60000, 0.00777}, {4.80000, 0.00443}, {5.00000, 0.00160}, {5.20000, 0.00083}, + {5.40000, 0.00050}, {5.60000, 0.00022}, {5.80000, 0.00010}, {6.00000, 0.00000}, + }, + // MCS-2 + { + {4.80000, 1.00000}, {5.00000, 0.99751}, {5.20000, 0.94575}, {5.40000, 0.86985}, {5.60000, 0.67282}, + {5.80000, 0.48313}, {6.00000, 0.27809}, {6.20000, 0.19251}, {6.40000, 0.09300}, {6.60000, 0.05184}, + {6.80000, 0.02559}, {7.00000, 0.01407}, {7.20000, 0.00670}, {7.40000, 0.00360}, {7.60000, 0.00175}, + {7.80000, 0.00088}, {8.00000, 0.00055}, {8.20000, 0.00025}, {8.40000, 0.00007}, {8.60000, 0.00005}, + {8.80000, 0.00000}, + }, + // MCS-3 + { + {8.00000, 1.00000}, {8.20000, 0.99751}, {8.40000, 0.97567}, {8.60000, 0.89709}, {8.80000, 0.76820}, + {9.00000, 0.60392}, {9.20000, 0.38857}, {9.40000, 0.26841}, {9.60000, 0.15543}, {9.80000, 0.08695}, + {10.00000, 0.04018}, {10.20000, 0.02370}, {10.40000, 0.01189}, {10.60000, 0.00643}, {10.80000, 0.00313}, + {11.00000, 0.00173}, {11.20000, 0.00090}, {11.40000, 0.00032}, {11.60000, 0.00018}, {11.80000, 0.00005}, + {12.00000, 0.00003}, {12.20000, 0.00000}, + }, + // MCS-4 + { + {11.20000, 1.00000}, {11.40000, 0.99012}, {11.60000, 0.94131}, {11.80000, 0.80200}, {12.00000, 0.66391}, + {12.20000, 0.43730}, {12.40000, 0.28911}, {12.60000, 0.17115}, {12.80000, 0.10219}, {13.00000, 0.05927}, + {13.20000, 0.03395}, {13.40000, 0.01924}, {13.60000, 0.01083}, {13.80000, 0.00588}, {14.00000, 0.00265}, + {14.20000, 0.00145}, {14.40000, 0.00068}, {14.60000, 0.00035}, {14.80000, 0.00018}, {15.00000, 0.00005}, + {15.20000, 0.00000}, + }, + // MCS-5 + { + {15.00000, 1.00000}, {15.20000, 0.99257}, {15.40000, 0.96394}, {15.60000, 0.92184}, {15.80000, 0.81010}, + {16.00000, 0.65846}, {16.20000, 0.50631}, {16.40000, 0.37938}, {16.60000, 0.23672}, {16.80000, 0.15382}, + {17.00000, 0.10256}, {17.20000, 0.06430}, {17.40000, 0.03643}, {17.60000, 0.02224}, {17.80000, 0.01320}, + {18.00000, 0.00790}, {18.20000, 0.00453}, {18.40000, 0.00273}, {18.60000, 0.00115}, {18.80000, 0.00070}, + {19.00000, 0.00052}, {19.20000, 0.00025}, {19.40000, 0.00015}, {19.60000, 0.00010}, {19.80000, 0.00003}, + {20.00000, 0.00000}, + }, + // MCS-6 + { + {16.00000, 1.00000}, {16.20000, 0.99751}, {16.40000, 0.99751}, {16.60000, 0.99012}, {16.80000, 0.93911}, + {17.00000, 0.89509}, {17.20000, 0.76967}, {17.40000, 0.60483}, {17.60000, 0.45881}, {17.80000, 0.31109}, + {18.00000, 0.20470}, {18.20000, 0.12686}, {18.40000, 0.08283}, {18.60000, 0.05102}, {18.80000, 0.03264}, + {19.00000, 0.01910}, {19.20000, 0.01107}, {19.40000, 0.00677}, {19.60000, 0.00445}, {19.80000, 0.00228}, + {20.00000, 0.00110}, {20.20000, 0.00050}, {20.40000, 0.00038}, {20.60000, 0.00015}, {20.80000, 0.00010}, + {21.00000, 0.00007}, {21.20000, 0.00003}, {21.40000, 0.00000}, + }, + // MCS-7 + { + {17.80000, 1.00000}, {18.00000, 0.98284}, {18.20000, 0.91972}, {18.40000, 0.78937}, {18.60000, 0.65203}, + {18.80000, 0.48902}, {19.00000, 0.32869}, {19.20000, 0.21817}, {19.40000, 0.14835}, {19.60000, 0.08870}, + {19.80000, 0.05506}, {20.00000, 0.03440}, {20.20000, 0.02175}, {20.40000, 0.01328}, {20.60000, 0.00673}, + {20.80000, 0.00415}, {21.00000, 0.00285}, {21.20000, 0.00150}, {21.40000, 0.00090}, {21.60000, 0.00040}, + {21.80000, 0.00032}, {22.00000, 0.00010}, {22.20000, 0.00007}, {22.40000, 0.00005}, {22.60000, 0.00000}, + }, + // MCS-8 + { + {20.80000, 1.00000}, {21.00000, 0.99257}, {21.20000, 0.98768}, {21.40000, 0.96394}, {21.60000, 0.90930}, + {21.80000, 0.80522}, {22.00000, 0.67966}, {22.20000, 0.59584}, {22.40000, 0.44605}, {22.60000, 0.35330}, + {22.80000, 0.25955}, {23.00000, 0.19391}, {23.20000, 0.15323}, {23.40000, 0.09721}, {23.60000, 0.07040}, + {23.80000, 0.04871}, {24.00000, 0.03459}, {24.20000, 0.02438}, {24.40000, 0.01740}, {24.60000, 0.01167}, + {24.80000, 0.00822}, {25.00000, 0.00570}, {25.20000, 0.00420}, {25.40000, 0.00293}, {25.60000, 0.00185}, + {25.80000, 0.00143}, {26.00000, 0.00100}, {26.20000, 0.00085}, {26.40000, 0.00068}, {26.60000, 0.00047}, + {26.80000, 0.00040}, {27.00000, 0.00020}, {27.20000, 0.00000}, + }, + // MCS-9 + { + {22.80000, 1.00000}, {23.00000, 0.99751}, {23.20000, 0.98526}, {23.40000, 0.93473}, {23.60000, 0.83195}, + {23.80000, 0.71352}, {24.00000, 0.58200}, {24.20000, 0.43682}, {24.40000, 0.30356}, {24.60000, 0.21375}, + {24.80000, 0.15621}, {25.00000, 0.10932}, {25.20000, 0.06856}, {25.40000, 0.04815}, {25.60000, 0.03408}, + {25.80000, 0.02385}, {26.00000, 0.01641}, {26.20000, 0.01043}, {26.40000, 0.00685}, {26.60000, 0.00480}, + {26.80000, 0.00360}, {27.00000, 0.00240}, {27.20000, 0.00168}, {27.40000, 0.00108}, {27.60000, 0.00072}, + {27.80000, 0.00055}, {28.00000, 0.00035}, {28.20000, 0.00020}, {28.40000, 0.00015}, {28.60000, 0.00008}, + {28.80000, 0.00000}, + }, +}; + +} //namespace ns3 + +#endif /* ERROR_RATE_TABLES_H */ diff --git a/src/wifi/wscript b/src/wifi/wscript index e7274e1bd..38e03626e 100644 --- a/src/wifi/wscript +++ b/src/wifi/wscript @@ -237,6 +237,7 @@ def build(bld): 'model/constant-obss-pd-algorithm.h', 'model/wifi-ack-policy-selector.h', 'model/constant-wifi-ack-policy-selector.h', + 'model/reference/error-rate-tables.h', 'helper/wifi-radio-energy-model-helper.h', 'helper/athstats-helper.h', 'helper/wifi-helper.h',