diff --git a/README.md b/README.md index 5dec668..e051b3d 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,7 @@ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 ``` The configuration can be made persistently by editing/adding `/etc/sysctl.d/`. + +## Data + +Example data and results can be found [here](https://nextcloud.schmidt-systems.eu/s/AYqZDwtWxAeQY8N). diff --git a/scripts/visualize_rnti_matching.py b/scripts/visualize_rnti_matching.py index 24a9529..88551f8 100755 --- a/scripts/visualize_rnti_matching.py +++ b/scripts/visualize_rnti_matching.py @@ -31,7 +31,7 @@ MAX_TOTAL_UL_FACTOR = 200.0 MIN_TOTAL_UL_FACTOR = 0.005 # x% of the expected UL traffic MAX_UL_PER_DCI_THRESHOLD = 5_000_000 -MIN_OCCURENCES_FACTOR = 0.005 +MIN_OCCURENCES_FACTOR = 0.05 # Plotting PLOT_SCATTER_MARKER_SIZE = 10 @@ -464,7 +464,7 @@ def standardize(settings): std_count = (np.mean(count_vec), np.std(count_vec)) std_total_ul = (np.mean(total_ul_vec), np.std(total_ul_vec)) - std_ul_timeline_median = ( + ul_timeline_median = ( np.mean(ul_timeline_matrix[:, 0]), np.std(ul_timeline_matrix[:, 0]) ) @@ -498,7 +498,7 @@ def standardize(settings): print("vec![") print(f" ({std_count[0]:.3f}, {std_count[1]:.3f}),") print(f" ({std_total_ul[0]:.3f}, {std_total_ul[1]:.3f}),") - print(f" ({std_ul_timeline_median[0]:.3f}, {std_ul_timeline_median[1]:.3f}),") + print(f" ({ul_timeline_median[0]:.3f}, {ul_timeline_median[1]:.3f}),") print(f" ({ul_timeline_mean[0]:.3f}, {ul_timeline_mean[1]:.3f}),") print(f" ({ul_timeline_variance[0]:.3f}, {ul_timeline_variance[1]:.3f}),") print(f" ({dci_time_deltas_median[0]:.3f}, {dci_time_deltas_median[1]:.3f}),") @@ -522,7 +522,7 @@ def read_all_recordings(settings): def determine_highest_count_ul_timeline(df): - rnti = "11223" + rnti = "11852" target_traffic: pd.DataFrame = pd.DataFrame() if not rnti in df.columns: diff --git a/src/logic/rnti_matcher.rs b/src/logic/rnti_matcher.rs index 91f8851..c3a665a 100644 --- a/src/logic/rnti_matcher.rs +++ b/src/logic/rnti_matcher.rs @@ -41,7 +41,7 @@ pub const COLLECT_DCI_MAX_TIMESTAMP_DELTA_US: u64 = 50000; pub const BASIC_FILTER_MAX_TOTAL_UL_FACTOR: f64 = 200.0; pub const BASIC_FILTER_MIN_TOTAL_UL_FACTOR: f64 = 0.005; pub const BASIC_FILTER_MAX_UL_PER_DCI: u64 = 5_000_000; -pub const BASIC_FILTER_MIN_OCCURENCES_FACTOR: f64 = 0.005; +pub const BASIC_FILTER_MIN_OCCURENCES_FACTOR: f64 = 0.05; pub const RNTI_RING_BUFFER_SIZE: usize = 5; @@ -805,7 +805,7 @@ fn feature_distance_matrices( &weightings_vector); // Uncomment and implement debug print if needed - // print_debug(&format!("DEBUG [rntimatcher] distances: {:.2}", euclidean_distances)); + print_debug(&format!("DEBUG [rntimatcher] distances: {:.2}", euclidean_distances)); let mut rnti_and_distance: Vec<(u16, f64)> = cell_traffic.traffic.keys() .cloned() diff --git a/src/logic/traffic_patterns.rs b/src/logic/traffic_patterns.rs index 2cd14cd..3901f2c 100644 --- a/src/logic/traffic_patterns.rs +++ b/src/logic/traffic_patterns.rs @@ -209,16 +209,15 @@ fn pattern_a() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::A, messages: generate_incremental_pattern(1, 7, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1303.524, 118.975), + (5170909.524, 328405.228), + (989.143, 104.019), + (3984.789, 274.161), + (31582535.518, 4674047.579), + (5258.446, 482.658), + (8269.488, 719.246), + (96718304.958, 49552811.538) ], } } @@ -227,16 +226,15 @@ fn pattern_b() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::B, messages: generate_incremental_pattern(5, 7, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (5112.829, 687.871), - (35530994.057, 5229654.427), - (1893.257, 1701.453), - (6958.369, 595.488), - (70584056.539, 15275088.919), - (4216.443, 592.529), - (5257.455, 742.506), - (29897761.426, 38041362.647), + (1172.476, 84.147), + (1070693.524, 88380.296), + (436.667, 49.241), + (914.404, 59.475), + (1656085.165, 225857.600), + (5258.113, 482.284), + (9032.604, 617.573), + (225072559.429, 136364731.413) ], } } @@ -247,14 +245,14 @@ fn pattern_c() -> TrafficPattern { messages: generate_incremental_pattern(10, 7, 10000, 1), /* DUMMY STD_VEC */ std_vec: vec![ - (5506.000, 370.136), - (46840983.314, 3698612.070), - (2457.829, 1445.095), - (8508.389, 366.796), - (88656831.248, 8468478.266), - (3925.357, 157.284), - (4794.976, 294.362), - (51687966.768, 102163561.246), + (1686.060, 89.275), + (806351.810, 59070.611), + (404.381, 35.977), + (477.924, 16.758), + (285107.429, 95070.207), + (4956.214, 69.591), + (6269.322, 311.308), + (154037780.727, 152680400.422) ], } } @@ -263,16 +261,15 @@ fn pattern_d() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::D, messages: generate_incremental_pattern(15, 7, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4033.685, 1241.680), - (40102402.815, 12125065.759), - (9740.000, 4245.484), - (10010.720, 892.519), - (95905843.575, 27841845.809), - (3720.194, 618.443), - (7359.077, 2938.561), - (3492377743.477, 13955565407.330), + (1634.381, 96.456), + (744945.238, 55137.483), + (399.667, 57.232), + (455.631, 16.472), + (281419.406, 204011.793), + (4959.494, 75.904), + (6460.818, 378.365), + (164091450.826, 130185927.368) ], } } @@ -283,14 +280,14 @@ fn pattern_e() -> TrafficPattern { messages: generate_incremental_pattern(20, 7, 10000, 1), /* DUMMY STD_VEC */ std_vec: vec![ - (7076.078, 1322.567), - (84959693.091, 16536550.367), - (13803.740, 1147.954), - (12002.835, 465.873), - (51426415.654, 10688602.674), - (2408.825, 434.685), - (3860.716, 721.621), - (81868020.141, 107397581.426), + (1590.107, 133.691), + (761000.857, 130823.198), + (492.190, 143.579), + (476.569, 33.139), + (266374.380, 74522.723), + (4953.548, 212.955), + (6651.133, 470.289), + (169247947.552, 142828361.282) ], } } @@ -301,14 +298,14 @@ fn pattern_f() -> TrafficPattern { messages: generate_incremental_pattern(40, 7, 10000, 1), /* DUMMY STD_VEC */ std_vec: vec![ - (4963.692, 1691.421), - (60475162.154, 18629696.408), - (13202.769, 1750.840), - (12332.931, 881.872), - (64867114.805, 20203503.942), - (2344.231, 301.511), - (5792.186, 2363.042), - (1210676863.405, 1269774046.111), + (1531.250, 305.115), + (740691.524, 149809.699), + (601.143, 139.415), + (493.095, 77.938), + (535847.681, 1587361.050), + (4961.327, 232.483), + (7939.456, 7846.388), + (714104054.473, 3459849560.506) ], } } @@ -335,16 +332,15 @@ fn pattern_g() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::G, messages, - /* DUMMY STD_VEC */ std_vec: vec![ - (4963.692, 1691.421), - (60475162.154, 18629696.408), - (13202.769, 1750.840), - (12332.931, 881.872), - (64867114.805, 20203503.942), - (2344.231, 301.511), - (5792.186, 2363.042), - (1210676863.405, 1269774046.111), + (1148.651, 98.184), + (1933892.434, 154693.582), + (635.470, 123.712), + (1687.174, 100.500), + (7489696.214, 690971.647), + (5384.024, 603.123), + (9239.849, 810.738), + (226870405.729, 176491669.660) ], } } @@ -353,16 +349,15 @@ fn pattern_h() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::H, messages: generate_incremental_pattern(1, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1693.843, 119.172), + (9066416.096, 644568.033), + (1275.277, 95.283), + (5357.688, 248.610), + (46548500.312, 8135171.036), + (4903.181, 228.600), + (6337.070, 465.706), + (51189570.636, 35430664.134) ], } } @@ -371,16 +366,15 @@ fn pattern_i() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::I, messages: generate_incremental_pattern(5, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1150.181, 82.893), + (1906619.855, 139984.909), + (614.843, 129.855), + (1660.314, 98.195), + (6746274.694, 684085.416), + (5336.831, 460.689), + (9199.727, 697.511), + (238238507.979, 175873328.231) ], } } @@ -389,16 +383,15 @@ fn pattern_j() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::J, messages: generate_incremental_pattern(10, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1596.771, 86.693), + (1067878.072, 76791.272), + (404.145, 11.541), + (668.671, 29.795), + (883962.435, 140006.832), + (4971.090, 22.084), + (6627.635, 430.548), + (176614657.043, 151487358.596) ], } } @@ -407,16 +400,15 @@ fn pattern_k() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::K, messages: generate_incremental_pattern(15, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1676.349, 75.166), + (1023226.506, 55433.586), + (691.759, 32.104), + (610.347, 17.320), + (487100.040, 74348.940), + (4962.952, 9.933), + (6292.111, 284.696), + (152140483.957, 129298296.787) ], } } @@ -425,16 +417,15 @@ fn pattern_l() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::L, messages: generate_incremental_pattern(20, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1611.373, 81.038), + (952066.120, 54675.723), + (692.530, 31.421), + (590.871, 17.377), + (445069.843, 67743.001), + (4970.795, 17.327), + (6551.890, 350.497), + (170340777.801, 137116780.191) ], } } @@ -443,16 +434,15 @@ fn pattern_m() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::M, messages: generate_incremental_pattern(40, 8, 10000, 1), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (1581.639, 236.698), + (889980.723, 360202.897), + (693.494, 107.704), + (553.752, 73.131), + (359658.484, 76077.035), + (4912.337, 336.816), + (6711.155, 593.530), + (160538634.769, 144251782.604) ], } } @@ -461,16 +451,15 @@ fn pattern_n() -> TrafficPattern { TrafficPattern { pattern_type: RntiMatchingTrafficPatternType::N, messages: generate_incremental_pattern(40, 8, 5000, 5000), - /* DUMMY STD_VEC */ std_vec: vec![ - (4298.972, 655.833), - (8977880.222, 1309843.824), - (914.222, 100.852), - (2098.996, 192.174), - (14021412.605, 1704132.447), - (4694.583, 654.029), - (6267.872, 969.600), - (294670529.455, 312539196.447), + (881.566, 464.619), + (510269.494, 464966.950), + (664.675, 159.314), + (553.049, 87.271), + (407529.896, 147616.223), + (4853.566, 594.289), + (13015.614, 4761.492), + (5964307190.392, 6330999966.655) ], } }