diff --git a/executables/injection_rate_test.cpp b/executables/injection_rate_test.cpp index fde3a319..1b58a4ba 100644 --- a/executables/injection_rate_test.cpp +++ b/executables/injection_rate_test.cpp @@ -50,15 +50,6 @@ static TestResult increase_pps_until_fail(std::shared_ptr txrx,const int txrx->tx_reset_stats(); stream_generator->start(); m_console->info("Testing MCS {} with {} pps", mcs, pps); - /*const auto begin=std::chrono::steady_clock::now(); - while (std::chrono::steady_clock::now()-beginget_tx_stats(); - if(txstats.count_tx_injections_error_hint>0 || stream_generator->n_times_cannot_keep_up_wanted_pps>20){ - // stop early - break ; - } - std::this_thread::sleep_for(std::chrono::seconds(1)); - }*/ std::this_thread::sleep_for(std::chrono::seconds(3)); const auto txstats = txrx->get_tx_stats(); if (txstats.count_tx_injections_error_hint > 0 || stream_generator->n_times_cannot_keep_up_wanted_pps>10 ) { @@ -200,19 +191,25 @@ void long_test(std::shared_ptr txrx,bool use_40mhz){ txrx->tx_update_channel_width(freq_w); const auto res_first= calculate_rough(txrx,50); const auto res_second= calculate_rough(txrx,50); + const auto res_third= calculate_rough(txrx,50); m_console->info("First run:"); print_test_results_rough(res_first); m_console->info("Second run:"); print_test_results_rough(res_second); + m_console->info("Third run:"); + print_test_results_rough(res_third); m_console->info("---------------------------"); m_console->info("First run:"); print_test_results_and_theoretical(res_first, use_40mhz); m_console->info("Second run:"); print_test_results_and_theoretical(res_second, use_40mhz); + m_console->info("Third run:"); + print_test_results_and_theoretical(res_third, use_40mhz); for(int i=0;iinfo("MCS {} possible {}--{}",res_first.at(i).mcs_index, + m_console->info("MCS {} possible {}--{}--{}",res_first.at(i).mcs_index, StringHelper::bitrate_readable(res_first.at(i).pass_bps_measured), - StringHelper::bitrate_readable(res_second.at(i).pass_bps_measured)); + StringHelper::bitrate_readable(res_second.at(i).pass_bps_measured), + StringHelper::bitrate_readable(res_third.at(i).pass_bps_measured)); } } @@ -271,7 +268,7 @@ int main(int argc, char *const *argv) { //m_console->info("Short guard"); //print_test_results_rough(res_sgi); - long_test(txrx, false); + long_test(txrx, true); /*txrx->tx_update_channel_width(20); const auto res_20mhz= calculate_rough(txrx,20); diff --git a/src/HelperSources/Rates.hpp b/src/HelperSources/Rates.hpp index 4e4e40c4..df277bd1 100644 --- a/src/HelperSources/Rates.hpp +++ b/src/HelperSources/Rates.hpp @@ -46,14 +46,14 @@ static std::vector openhd_rtl8812au_5G_practical_rates() { Rate{11000,0}, // MCS 1 Rate{15000,0}, // MCS 2 Rate{19000,0}, // MCS 3 - Rate{26120,0}, // MCS 4 - Rate{33230,0}, // MCS 5 - Rate{33330,0}, // MCS 6 - Rate{36060,0}, // MCS 7 - Rate{5530 ,0}, // MCS 8 - Rate{11480,0}, // MCS 9 - Rate{13810,0}, // MCS 10 - Rate{14240,0}, // MCS 11 + Rate{26000,0}, // MCS 4 + Rate{26000,0}, // MCS 5 + Rate{32000,0}, // MCS 6 + Rate{38000,0}, // MCS 7 + Rate{11000 ,0}, // MCS 8 + Rate{19000,0}, // MCS 9 + Rate{27000,0}, // MCS 10 + Rate{32000,0}, // MCS 11 }; } diff --git a/src/WBTxRx.cpp b/src/WBTxRx.cpp index 03f188ea..a83be2bf 100644 --- a/src/WBTxRx.cpp +++ b/src/WBTxRx.cpp @@ -307,7 +307,7 @@ void WBTxRx::on_new_packet(const uint8_t wlan_idx, const pcap_pkthdr &hdr, // Same for iee80211 seq nr uint16_t iee_seq_nr=parsedPacket->ieee80211Header->getSequenceNumber(); m_seq_nr_helper_iee80211.on_new_sequence_number(iee_seq_nr); - m_console->debug("IEE SEQ NR PACKET LOSS {}",m_seq_nr_helper_iee80211.get_current_loss_percent()); + //m_console->debug("IEE SEQ NR PACKET LOSS {}",m_seq_nr_helper_iee80211.get_current_loss_percent()); } // Adjustment of which card is used for injecting packets in case there are multiple RX card(s) if(m_wifi_cards.size()>1 && m_options.enable_auto_switch_tx_card){ @@ -502,8 +502,9 @@ bool WBTxRx::get_card_has_disconnected(int card_idx) { return m_card_is_disconnected[card_idx]; } std::string WBTxRx::tx_stats_to_string(const WBTxRx::TxStats& data) { - return fmt::format("TxStats[injected packets:{} bytes:{} tx errors:{} pps:{} bps:{}-{}]", - data.n_injected_packets,data.n_injected_bytes_including_overhead,data.count_tx_injections_error_hint, + return fmt::format("TxStats[injected packets:{} bytes:{} tx errors:{}-{} pps:{} bps:{}-{}]", + data.n_injected_packets,data.n_injected_bytes_including_overhead, + data.count_tx_injections_error_hint,data.count_tx_errors, data.curr_packets_per_second, StringHelper::bitrate_readable(data.curr_bits_per_second_excluding_overhead), StringHelper::bitrate_readable(data.curr_bits_per_second_including_overhead)); diff --git a/src/WBTxRx.h b/src/WBTxRx.h index 6e58afee..e3868dd8 100644 --- a/src/WBTxRx.h +++ b/src/WBTxRx.h @@ -131,13 +131,14 @@ class WBTxRx { int64_t n_injected_bytes_excluding_overhead =0; // including wifi / radiotap / encryption overhead int64_t n_injected_bytes_including_overhead =0; + // recalculated in X second intervals + int curr_packets_per_second=-1; + int curr_bits_per_second_excluding_overhead=-1; + int curr_bits_per_second_including_overhead=-1; // tx error hint, first sign the tx can't keep up with the provided bitrate int32_t count_tx_injections_error_hint=0; // actual tx errors int32_t count_tx_errors=0; - int curr_packets_per_second=-1; - int curr_bits_per_second_excluding_overhead=-1; - int curr_bits_per_second_including_overhead=-1; }; struct RxStats{ // Total count of received packets / bytes - can be from another wb tx, but also from someone else using wifi