@@ -265,7 +265,7 @@ void Receiver::loop_iter(void)
265
265
266
266
267
267
Aggregator::Aggregator (const string &client_addr, int client_port, const string &keypair, uint64_t epoch, uint32_t channel_id) : \
268
- count_p_all(0 ), count_b_all(0 ), count_p_dec_err(0 ), count_p_dec_ok (0 ), count_p_fec_recovered(0 ),
268
+ count_p_all(0 ), count_b_all(0 ), count_p_dec_err(0 ), count_p_session( 0 ), count_p_data (0 ), count_p_fec_recovered(0 ),
269
269
count_p_lost(0 ), count_p_bad(0 ), count_p_override(0 ), count_p_outgoing(0 ), count_b_outgoing(0 ),
270
270
fec_p(NULL ), fec_k(-1 ), fec_n(-1 ), seq(0 ), rx_ring{}, rx_ring_front(0 ), rx_ring_alloc(0 ),
271
271
last_known_block ((uint64_t )-1), epoch(epoch), channel_id(channel_id)
@@ -490,8 +490,14 @@ void Aggregator::dump_stats(void)
490
490
it->second .snr_min , it->second .snr_sum / it->second .count_all , it->second .snr_max );
491
491
}
492
492
493
- IPC_MSG (" %" PRIu64 " \t PKT\t %u:%u:%u:%u:%u:%u:%u:%u:%u\n " , ts, count_p_all, count_b_all, count_p_dec_err,
494
- count_p_dec_ok, count_p_fec_recovered, count_p_lost, count_p_bad, count_p_outgoing, count_b_outgoing);
493
+ IPC_MSG (" %" PRIu64 " \t PKT\t %u:%u:%u:%u:%u:%u:%u:%u:%u:%u:%u\n " , ts,
494
+ count_p_all, count_b_all, // incoming
495
+ count_p_dec_err, // decryption
496
+ count_p_session, count_p_data, // classification
497
+ (uint32_t )count_p_uniq.size (), // unique check
498
+ count_p_fec_recovered, count_p_lost, // fec recovering
499
+ count_p_bad, // internal errors
500
+ count_p_outgoing, count_b_outgoing); // outgoing
495
501
IPC_MSG_SEND ();
496
502
497
503
if (count_p_override)
@@ -643,8 +649,11 @@ void Aggregator::process_packet(const uint8_t *buf, size_t size, uint8_t wlan_id
643
649
return ;
644
650
}
645
651
646
- count_p_dec_ok += 1 ;
647
- log_rssi (sockaddr, wlan_idx, antenna, rssi, noise, freq, mcs_index, bandwidth);
652
+ count_p_session += 1 ;
653
+
654
+ // Ignore RSSI (and per-card rx counters) for session packets to simplify calculation
655
+ // of lost packets because session packets doesn't have any serial number and it is
656
+ // too hard to calculate number of unique session packets
648
657
649
658
if (memcmp (session_key, new_session_data->session_key , sizeof (session_key)) != 0 )
650
659
{
@@ -686,7 +695,7 @@ void Aggregator::process_packet(const uint8_t *buf, size_t size, uint8_t wlan_id
686
695
return ;
687
696
}
688
697
689
- count_p_dec_ok += 1 ;
698
+ count_p_data += 1 ;
690
699
log_rssi (sockaddr, wlan_idx, antenna, rssi, noise, freq, mcs_index, bandwidth);
691
700
692
701
assert (decrypted_len >= sizeof (wpacket_hdr_t ));
@@ -695,6 +704,8 @@ void Aggregator::process_packet(const uint8_t *buf, size_t size, uint8_t wlan_id
695
704
uint64_t block_idx = be64toh (block_hdr->data_nonce ) >> 8 ;
696
705
uint8_t fragment_idx = (uint8_t )(be64toh (block_hdr->data_nonce ) & 0xff );
697
706
707
+ count_p_uniq.insert (be64toh (block_hdr->data_nonce ));
708
+
698
709
// Should never happend due to generating new session key on tx side
699
710
if (block_idx > MAX_BLOCK_IDX)
700
711
{
0 commit comments