Flow 1.0.1
Flow project: Full implementation reference.
info.hpp
Go to the documentation of this file.
1/* Flow
2 * Copyright 2023 Akamai Technologies, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the
5 * "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in
12 * writing, software distributed under the License is
13 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
14 * CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing
16 * permissions and limitations under the License. */
17
18/// @file
19#pragma once
20
23#include <boost/utility.hpp>
24#include <boost/array.hpp>
25#include <map>
26#include <iostream>
27
28namespace flow::net_flow
29{
30// Types.
31
32/**
33 * A data store that keeps stats about the incoming direction of a Peer_socket connection to another
34 * Flow-protocol Peer_socket. Note that this also includes stats about *outgoing* traffic that facilitates
35 * further incoming traffic (namely, data on outgoing acknowledgments are in this structure).
36 *
37 * The objects also have an `ostream` output interface for human-readability, e.g., for logs.
38 *
39 * The user can obtain objects representing actual stats via Peer_socket::info().
40 *
41 * ### Thread safety ###
42 * Same as any `struct` with no locking done therein.
43 *
44 * @warning It is very heavily discouraged to make algorithmic decisions based on the data in these
45 * objects. They are for human diagnostics, information, and debugging only. For example, some data
46 * represented may pertain to internal implementation; other data may not be up-to-date; etc.
47 *
48 * @internal
49 *
50 * The internal implementation keeps this `struct` within the accumulator
51 * Peer_socket_receive_stats_accumulator and has some methods to conveniently accumulate the stats.
52 */
54{
55 // Constructors/destructor.
56
57 /// Constructs object by initializing stats to their initial values.
59
60 // Methods.
61
62 /**
63 * Outputs the current stats, across multiple lines but not ending with a newline, into the given
64 * output stream. `operator<<()` uses this and is more likely to be used directly by the class
65 * user.
66 *
67 * @param os
68 * Stream to which to serialize.
69 */
70 void output(std::ostream* os) const;
71
72 // Data.
73
74 /// The time this object (or source object from assignment) was made; should be about equal to when socket was made.
76
77 /// Bytes in DATA packets received on socket.
79 /// Number of DATA packets received on socket.
81
82 /// Of #m_total_data_size, the data that were new and acceptable into Receive buffer assuming there was space.
84 /// Of #m_total_data_count, the data that were new and acceptable into Receive buffer assuming there was space.
86
87 /**
88 * Of #m_good_data_size, the data that were not dropped (so either delivered into Receive buffer or
89 * queued for reassembly later).
90 */
92 /**
93 * Of #m_good_data_count, the data that were not dropped (so either delivered into Receive buffer
94 * or queued for reassembly later).
95 */
97
98 /**
99 * Of #m_good_data_accepted_size, the data that were delivered into Receive buffer (either
100 * immediately upon receipt or upon later reassembly).
101 */
103 /**
104 * Of #m_good_data_accepted_count, the data that were delivered into Receive buffer (either
105 * immediately upon receipt or upon later reassembly).
106 */
108
109 /**
110 * Of #m_good_data_accepted_size, the data that were, upon receipt, queued for reassembly
111 * (not immediately delivered into Receive buffer).
112 */
114 /**
115 * Of #m_good_data_accepted_count, the data that were, upon receipt, queued for reassembly (not
116 * immediately delivered into Receive buffer).
117 */
119
120 /**
121 * Of #m_good_data_size, the data that were dropped due to insufficient Receive buffer
122 * space.
123 */
125 /**
126 * Of #m_good_data_count, the data that were dropped due to insufficient Receive buffer space.
127 */
129
130 /**
131 * Of #m_good_data_size, the data that were dropped due to insufficient Receive reassembly queue
132 * space (only possible when retransmission is enabled).
133 */
135 /**
136 * Of #m_good_data_count, the data that were dropped due to insufficient Receive reassembly queue
137 * space (only possible when retransmission is enabled).
138 */
140
141 /**
142 * Of #m_total_data_size, the data that contained some error about the sequence numbers so that
143 * they were not acceptable, and the connection did/will close as a result.
144 */
146 /**
147 * Of #m_total_data_count, the data that contained some error about the sequence numbers so that
148 * they were not acceptable, and the connection did/will close as a result.
149 */
151
152 /**
153 * Of #m_total_data_size, the data that had either already been received before or (more likely)
154 * had been considered Dropped by now; therefore these data not delivered to Receive buffer.
155 */
157 /**
158 * Of #m_total_data_count, the data that had either already been received before or (more likely)
159 * had been considered Dropped by now; therefore these data not delivered to Receive buffer.
160 */
162
163 /**
164 * Total number of bytes in hypothetical data packets that have been considered Dropped due to the
165 * number of later packets that have been received. For each such packet that does arrive in the
166 * future (though unlikely), #m_late_or_dupe_data_size and #m_late_or_dupe_data_count will increase.
167 */
169
170 /**
171 * Bytes in received DATA packets acknowledged thus far or that have been received and are pending
172 * to be acknowledged.
173 */
175 /**
176 * Number of DATA packets acknowledged thus far or that have been received and are pending to be
177 * acknowledged.
178 */
180
181 /**
182 * Of #m_total_to_send_acks_data_size, the data that also satisfy the criteria in
183 * #m_good_data_delivered_size. That is, bytes acknowledged due to being received and delivered
184 * into Receive buffer.
185 */
187 /**
188 * Of #m_total_to_send_acks_count, the data that also satisfy the criteria in
189 * #m_good_data_delivered_count.
190 */
192
193 /**
194 * Of #m_total_to_send_acks_data_size, the data that also satisfy the criteria in
195 * #m_late_or_dupe_data_size. That is, bytes acknowledged due to being received but no longer
196 * acceptable into Receive buffer (due to being duplicate or late).
197 */
199 /**
200 * Of #m_total_to_send_acks_count, the data that also satisfy the criteria in
201 * #m_late_or_dupe_data_count.
202 */
204
205 /**
206 * Of #m_total_to_send_acks_count, the packets that have not yet been sent to the sender (pending
207 * acknowledgments).
208 */
210
211 /**
212 * The total number of individual packet acknowledgments whose sending was delayed (via delayed
213 * ACK mechanism) beyond the handler in which they were originally constructed.
214 */
216
217 /**
218 * Number of DATA packets such that for a given packet an individual acknowledgment has been packaged
219 * into an ACK packet that has been sent or will be sent as soon as possible.
220 */
222
223 /// Number of low-level ACK packets that have been sent or will be sent as soon as possible.
225
226 /**
227 * Number of times we detected (heuristically but fairly reliably) that the following event
228 * occurred: our rcv_wnd (or free Receive buffer space) was exhausted; but then significatly freed
229 * by application-layer `receive()` calls. When this event is detected we immediately attempt to
230 * inform the sender, so that it may resume sending (which it probably stopped due to empty
231 * receive window); we then periodically keep informing the sender of this, until more data arrive
232 * or a certain amount of time passes (whichever occurs first).
233 *
234 * In some situations the sender simply stopping to send data (at the application layer) can be
235 * mistakenly identified as such an event, but this is basically harmless.
236 */
238
239 /**
240 * Of #m_rcv_wnd_recovery_count, the number of times the recovery was successful: i.e., resulted in
241 * more data packets arriving from sender.
242 */
244
245 /**
246 * Of #m_rcv_wnd_recovery_count, the number of times the recovery failed: i.e., resulted in
247 * a certain lengthy timeout firing before any more data packets arrived from sender. (This would
248 * happen either due to extremely loss, or because the sender had really stopped sending data at
249 * the application layer [so this was not a real rcv_wnd exhaustion event after all].)
250 */
252
253 /**
254 * Of #m_sent_low_lvl_acks_count, the packets that contained no individual acknowledgments but
255 * are to be sent only to advertise rcv_wnd.
256 */
258
259 /// Maximum number of bytes in the Receive buffer so far.
261
262 /**
263 * Total size in serialized form of low-level packets received targeted at this socket, split up
264 * by polymorphic sub-type ID `type_index(typeid(p))`, where `p` is a reference to an instance of a sub-type of
265 * Low_lvl_packet (or, in English, by packet type).
266 */
267 std::map<std::type_index, uint64_t> m_low_lvl_packet_size_by_type;
268
269 /**
270 * Count of low-level packets received targeted at this socket, split up by packet type similarly to
271 * #m_low_lvl_packet_size_by_type.
272 */
273 std::map<std::type_index, uint64_t> m_low_lvl_packet_count_by_type;
274}; // struct Peer_socket_receive_stats
275
276/**
277 * A data store that keeps stats about the outgoing direction of a Peer_socket connection to another
278 * Flow-protocol Peer_socket. Note that this also includes stats about *incoming* traffic that facilitates
279 * further outgoing traffic (namely, data on incoming acknowledgments are in this class).
280 *
281 * All other comments in Peer_socket_receive_stats doc header apply equally to this class.
282 *
283 * @see Peer_socket_receive_stats
284 */
286{
287public:
288 // Constructors/destructor.
289
290 /// Constructs object by initializing stats to their initial values.
291 explicit Peer_socket_send_stats();
292
293 // Methods.
294
295 /**
296 * Outputs the current stats, across multiple lines but not ending with a newline, into the given
297 * output stream. `operator<<()` uses this and is more likely to be used directly by the class
298 * user.
299 *
300 * @param os
301 * Stream to which to serialize.
302 */
303 void output(std::ostream* os) const;
304
305 // Data.
306
307 /**
308 * The time this object was created; should be about equal to when the socket was created.
309
310 * @todo Peer_socket_receive_stats also independently stores a similar value, so to save memory
311 * put #m_init_time elsewhere.
312 */
314
315 /// Total bytes sent in DATA packets.
317 /// Number of packets sent in DATA packets.
319
320 /// Of #m_sent_data_size, the data that were retransmitted (as opposed to original) data.
322 /// Of #m_sent_data_count, the data that were retransmitted (as opposed to original) data.
324
325 /// Number of low-level ACK packets received.
327
328 /**
329 * Of #m_received_low_lvl_ack_count, the packets that contained no individual acknowledgments
330 * but sent only to advertise rcv_wnd.
331 */
333
334 /// Individual acknowledgments inside low-level ACK packets that have been received (not necessarily all valid).
336
337 /// Whether the last rcv_wnd update from other side indicated window size < max-block-size bytes. `false` initially.
339
340 /// Number of times #m_rcv_wnd_exhausted changed from `false`.
342
343 /// Number of times #m_rcv_wnd_exhausted changed from `true` (not counting it being initially set to `false`).
345
346 /**
347 * Of the individual acknowledgments covered by #m_received_ack_count, the total bytes in the DATA
348 * packets that were properly acknowledged and converted from In-flight to Acknowledged status.
349 */
351 /**
352 * Of #m_received_ack_count, those packets that were properly acknowledged and converted from In-flight to
353 * Acknowledged status.
354 */
356
357 /**
358 * Of #m_received_ack_count, those packets that had either already been convered from In-flight to
359 * Acknowledged or (more likely) already been converted from In-flight to Dropped.
360 */
362
363 /**
364 * Of #m_received_ack_count, those acknowledgments that contained some error about the sequence
365 * numbers so that they were not acceptable, and the connection did/will close as a result.
366 */
368
369 /**
370 * Total bytes in sent DATA packets that are considered permanently dropped (i.e., whose status
371 * has changed from In-flight to Dropped).
372 */
374 /**
375 * Number of sent DATA packets that are considered permanently dropped (i.e., whose status
376 * has changed from In-flight to Dropped).
377 */
379
380 /**
381 * Number of loss events so far (not counting Drop Timeouts) that have been reported to congestion
382 * control module. (Note that multiple individual acknowledgments, and even multiple ACKs, can
383 * belong to one loss event and would only be counted once in thise case.)
384 */
386
387 /**
388 * Number of idle timeouts (in the send direction) so far that have been detected and indicated to
389 * congestion control module.
390 */
392
393 /// Number of times Drop Timer has fired so far.
395
396 /// Maximum number of bytes in the Send buffer so far.
398
399 /**
400 * Total count of low-level packets that were given to the sending module to be sent, subject to pacing if applicable,
401 * split up by packet type similarly to Peer_socket_receive_stats::m_low_lvl_packet_size_by_type.
402 */
403 std::map<std::type_index, uint64_t> m_low_lvl_packet_xfer_requested_count_by_type;
404
405 /**
406 * Total size in serialized form of low-level packets that were given to OS in a send call, from this socket,
407 * split up by packet type similarly to Peer_socket_receive_stats::m_low_lvl_packet_size_by_type.
408 */
409 std::map<std::type_index, boost::array<uint64_t, 2>> m_low_lvl_packet_xfer_called_size_by_type;
410
411 /**
412 * Count of low-level packets that were given to OS in a send call, from this socket,
413 * split up by packet type similarly to Peer_socket_receive_stats::m_low_lvl_packet_size_by_type.
414 */
415 std::map<std::type_index, boost::array<uint64_t, 2>> m_low_lvl_packet_xfer_called_count_by_type;
416
417 /**
418 * Of #m_low_lvl_packet_xfer_called_size_by_type, the data for which the send completion handler executed,
419 * split up further by the transfer result reported to the handler.
420 */
421 std::map<std::type_index, std::map<Xfer_op_result, uint64_t>> m_low_lvl_packet_xfer_completed_size_by_type_and_result;
422
423 /**
424 * Of #m_low_lvl_packet_xfer_called_count_by_type, the data for which the send completion handler executed,
425 * split up further by the transfer result reported to the handler.
426 */
427 std::map<std::type_index, std::map<Xfer_op_result, uint64_t>>
429}; // class Peer_socket_send_stats
430
431/**
432 * A data store that keeps stats about the a Peer_socket connection.
433 * This includes a Peer_socket_receive_stats `struct`, a Peer_socket_send_stats `struct`, and a few
434 * other individual pieces of data. Typically the former 2 accumulate data, while the other members
435 * may go up or down. This is not a hard rule however.
436 *
437 * The objects also have an `ostream` output interface for human-readability, e.g., for logs.
438 *
439 * The user can obtain objects representing actual stats via Peer_socket::info().
440 *
441 * ### Thread safety ###
442 * Same as any `struct` with no locking done therein.
443 *
444 * @warning It is very heavily discouraged to make algorithmic decisions based on the data in these
445 * objects. They are for human diagnostics, information, and debugging only. For example, some data
446 * represented may pertain to internal implementation; other data may not be up-to-date; etc.
447 *
448 * @internal
449 *
450 * This `struct` is only really used to communicate info to users; it bundles up some `struct`s and a
451 * few other pieces of data into one thing. It is not stored internally in thread W.
452 *
453 * Because they're user-exposed types here, #Fine_duration and #Fine_time_pt are re-aliased explicitly.
454 */
456{
457 // Types.
458
459 /// Short-hand for a fine boost.chrono time duration type.
461
462 /// Short-hand for a fine boost.chrono time point type.
464
465 // Constructors/destructor.
466
467 /// Constructs object by initializing stats to their initial values.
468 explicit Peer_socket_info();
469
470 // Methods.
471
472 /**
473 * Outputs the current stats, across multiple lines but not ending with a newline, into the given
474 * output stream. `operator<<()` uses this and is more likely to be used directly by the class
475 * user.
476 *
477 * @param os
478 * Stream to which to serialize.
479 */
480 void output(std::ostream* os) const;
481
482 /**
483 * Helper for various `output()` methods that outputs a one-line representation of a sorted map,
484 * with arbitrary keys and values. This representation will lack newlines and will include a wrapping
485 * pair of brackets `"[]"`.
486 *
487 * @tparam Key
488 * Type such that `output_pkt_count_key(os, k)`, with `Key k`, will output a one-line representation
489 * of `k` to `*os`. The representation should include wrapping brackets if desired.
490 * @tparam Value
491 * Analogous to `Key` but the function is `output_pkt_count_value(os, v)`.
492 * @param os
493 * See output().
494 * @param count_by_type
495 * Map whose values represent -- at some level (not necessarily directly) -- a packet count.
496 * @param size_by_type
497 * Map whose values represent a total byte count in packets counted by `count_by_type`.
498 * null pointer if no such map applies (i.e., only a count is available).
499 */
500 template<typename Key, typename Value>
501 static void output_map_of_pkt_counts(std::ostream* os,
502 const std::map<Key, Value>& count_by_type,
503 const std::map<Key, Value>* size_by_type);
504
505 // Data.
506
507 /// Stats for incoming direction of traffic. As opposed to the other `m_rcv_*` members, this typically accumulates.
509
510 /// Stats for outgoing direction of traffic. As opposed to the other `m_snd_*` members, this typically accumulates.
512
513 /**
514 * The UDP receive buffer maximum size, as reported by an appropriate call to the appropriate
515 * `getsockopt()` immediately after the Node sets the UDP receive buffer size via `setsockopt()`.
516 * The set value is determined by a socket option, but the OS may or may not respect that value.
517 *
518 * This value remains constant and the same for all Peer_socket objects for a given Node. It is set at
519 * Peer_socket creation.
520 *
521 * @internal
522 *
523 * @todo This is really a `Node`-wide value; we should probably have a `Node_info` class for such
524 * things.
525 */
527
528 /**
529 * The internal state of the socket, rendered into string (e.g., "SYN_RECEIVED" or "ESTABLISHED").
530 * Reminder: this is for informational purposes only -- for human consumption; do not try to base
531 * program code on this value under any circumstances.
532 */
533 std::string m_int_state_str;
534
535 /// `true` if this is the "client" socket (`connect()`ed); `false` otherwise (`accept()`ed).
537
538 /// If the socket is closing or closed, this is the reason for the closure; otherwise the default-constructed value.
540
541 /**
542 * The number of bytes in the internal Receive buffer. These are the bytes intended for the
543 * application layer's consumption that the application layer has not yet claimed with
544 * Peer_socket::receive() or similar method. When this exceeds the Receive buffer max size,
545 * incoming bytes will be dropped (which will cause at least the slowdown of traffic).
546 *
547 * Same reminder as for #m_int_state_str applies here.
548 */
550
551 /// Receive window size = max Receive buffer space minus space taken. Infinity if flow control disabled.
552 size_t m_rcv_wnd;
553
554 /// The last rcv_wnd (receive window) size sent to sender (not necessarily received; packets can be lost).
556
557 /// If `rexmit_on` is `false` then 0; otherwise the total DATA payload in the reassembly queue of the socket.
559
560 /**
561 * Number of DATA packets tracked in structure tracking all valid received packets such at least one packet
562 * that has not yet been received precedes (by sequence #) each one (in other words, all post-first-gap packets).
563 * If `rexmit_on` is `true`, this is the reassembly queue length; otherwise is is length of structure used to
564 * detect duplicate receipt of data past the first gap (and possibly other accounting purposes).
565 * An important subtlety is that in the latter case, as of this writing, there is no need to (and hence
566 * we don't) store the actual payload of those packets but only metadata like sequence numbers.
567 * That's why in that case #m_rcv_reassembly_q_data_size is zero and doesn't, in particular, count against
568 * rcv_wnd. (However, if `rexmit_on`, then it's not zero and does count.)
569 */
571
572 /// Total size of DATA payload queued while waiting for SYN_ACK_ACK in SYN_RCVD state.
574
575 /// Number of DATA packets queued while waiting for SYN_ACK_ACK in SYN_RCVD state.
577
578 /**
579 * The number of bytes in the internal Send buffer. These are the bytes provided by the
580 * application layer to send that have not yet been "sent over the network," for some definition
581 * of "sent over the network." The latter definition is not entirely unambiguous, but that should
582 * not matter to the library user.
583 *
584 * When this exceeds the Send buffer max size, Peer_socket::send() and similar methods will return
585 * 0 (meaning, cannot accept more bytes to send at this time). That should happen only if some
586 * aspect of networking is preventing Node from sending more data over network at this time.
587 *
588 * Same reminder as for #m_int_state_str applies here.
589 */
591
592 /**
593 * The receive window (rcv_wnd a/k/a free Receive buffer space) value of the peer socket on the
594 * other side, last advertised by the other side.
595 */
597
598 /// In congestion control, the current congestion window (number of outgoing data bytes allowed In-flight currently).
600
601 /// In congestion control, the approximate equivalent of #m_snd_cong_ctl_in_flight_bytes as a full packet count.
603
604 /**
605 * In congestion control, the current sent data bytes that have been neither acknowledged nor considered lost
606 * @todo Does #m_snd_cong_ctl_in_flight_bytes count data queued in the pacing module or truly In-flight data only?
607 */
609
610 /// In congestion control, the current sent data packets that have been neither acknowledged nor considered lost.
612
613 /// Estimated current round trip time of packets, computed as a smooth value over the past individual RTTs.
615
616 /// RTTVAR used for #m_snd_smoothed_round_trip_time calculation; it is the current RTT variance.
618
619 /// Drop Timeout: how long a given packet must remain unacknowledged to be considered dropped due to Drop Timeout.
621
622 /// In pacing, number of packets currently queued to be sent out by the pacing module.
624
625 /// In pacing, the time point marking the beginning of the current pacing time slice.
627
628 /// In pacing, the duration of the current pacing time slice.
630
631 /**
632 * This many bytes worth of DATA packets may still be sent, at this time, within the time slice
633 * defined by `m_slice_start` and `m_slice_period`.
634 */
636
637 /**
638 * Estimate of the currently available (to this connection) outgoing bandwidth, in megabits per
639 * second. A megabit is 1000 x 1000 bits (not 1024 x 1024, as people sometimes assume, that being a mebibit).
640 */
642
643 /// Per-socket options currently set on the socket.
645
646 /**
647 * Per-node options currently set on the socket's Node. Note that this includes the full set of per-socket
648 * options as well, but these will only potentially affect future sockets generated by the Node, not this socket.
649 * For the latter, see #m_sock_opts.
650 */
652
653private:
654 /**
655 * Helper for output_map_of_pkt_counts() that outputs a count or size.
656 *
657 * @param os
658 * See output().
659 * @param value
660 * Value.
661 */
662 static void output_pkt_count_value(std::ostream* os, uint64_t value);
663
664 /**
665 * Helper for output_map_of_pkt_counts() that outputs a pair of counts or sizes: the first for non-delayed
666 * packets; the second for ones delayed by pacing.
667 *
668 * @param os
669 * See output().
670 * @param value_by_delay_type
671 * Value.
672 */
673 static void output_pkt_count_value(std::ostream* os, const boost::array<uint64_t, 2>& value_by_delay_type);
674
675 /**
676 * Helper for output_map_of_pkt_counts() that outputs a mapping of counts or sizes, spliut up by the result
677 * of the transfer operation to which the count or size applies. Subtlety: If the value is a size *sent*,
678 * it should refer to the number that was EXPECTED to be sent (as opposed to the amount actually sent
679 * as reported by OS, which may report a number less than that expected or imply 0 by generating error).
680 *
681 * @param os
682 * See output().
683 * @param value_by_op_result
684 * Value.
685 */
686 static void output_pkt_count_value(std::ostream* os,
687 const std::map<Xfer_op_result, uint64_t>& value_by_op_result);
688
689 /**
690 * Helper for output_map_of_pkt_counts() that outputs a raw packet type ID index, namely `type_index(typeid(p))`,
691 * where `p` is a reference to an instance of a concrete Low_lvl_packet sub-type.
692 *
693 * @param os
694 * See output().
695 * @param type_id
696 * Value.
697 */
698 static void output_pkt_count_key(std::ostream* os, const std::type_index& type_id);
699
700 /**
701 * Helper for output_map_of_pkt_counts() that outputs a transfer operation result.
702 *
703 * @param os
704 * See output().
705 * @param op_result
706 * Value.
707 */
708 static void output_pkt_count_key(std::ostream* os, Xfer_op_result op_result);
709}; // struct Peer_socket_info
710
711// Free functions: in *_fwd.hpp.
712
713} // namespace flow::net_flow
A data store that keeps stats about the outgoing direction of a Peer_socket connection to another Flo...
Definition: info.hpp:286
uint64_t m_sent_rexmitted_data_count
Of m_sent_data_count, the data that were retransmitted (as opposed to original) data.
Definition: info.hpp:323
Fine_time_pt m_init_time
The time this object was created; should be about equal to when the socket was created.
Definition: info.hpp:313
uint64_t m_remote_rcv_wnd_recovery_events
Number of times m_rcv_wnd_exhausted changed from true (not counting it being initially set to false).
Definition: info.hpp:344
uint64_t m_sent_rexmitted_data_size
Of m_sent_data_size, the data that were retransmitted (as opposed to original) data.
Definition: info.hpp:321
Peer_socket_send_stats()
Constructs object by initializing stats to their initial values.
Definition: info.cpp:165
uint64_t m_received_ack_count
Individual acknowledgments inside low-level ACK packets that have been received (not necessarily all ...
Definition: info.hpp:335
size_t m_max_buf_data_size
Maximum number of bytes in the Send buffer so far.
Definition: info.hpp:397
uint64_t m_late_or_dupe_ack_count
Of m_received_ack_count, those packets that had either already been convered from In-flight to Acknow...
Definition: info.hpp:361
uint64_t m_drop_timeouts
Number of times Drop Timer has fired so far.
Definition: info.hpp:394
std::map< std::type_index, boost::array< uint64_t, 2 > > m_low_lvl_packet_xfer_called_size_by_type
Total size in serialized form of low-level packets that were given to OS in a send call,...
Definition: info.hpp:409
uint64_t m_idle_timeouts
Number of idle timeouts (in the send direction) so far that have been detected and indicated to conge...
Definition: info.hpp:391
uint64_t m_loss_events
Number of loss events so far (not counting Drop Timeouts) that have been reported to congestion contr...
Definition: info.hpp:385
uint64_t m_sent_data_size
Total bytes sent in DATA packets.
Definition: info.hpp:316
uint64_t m_sent_data_count
Number of packets sent in DATA packets.
Definition: info.hpp:318
std::map< std::type_index, std::map< Xfer_op_result, uint64_t > > m_low_lvl_packet_xfer_completed_count_by_type_and_result
Of m_low_lvl_packet_xfer_called_count_by_type, the data for which the send completion handler execute...
Definition: info.hpp:428
uint64_t m_good_ack_count
Of m_received_ack_count, those packets that were properly acknowledged and converted from In-flight t...
Definition: info.hpp:355
bool m_rcv_wnd_exhausted
Whether the last rcv_wnd update from other side indicated window size < max-block-size bytes....
Definition: info.hpp:338
void output(std::ostream *os) const
Outputs the current stats, across multiple lines but not ending with a newline, into the given output...
Definition: info.cpp:191
uint64_t m_dropped_data_size
Total bytes in sent DATA packets that are considered permanently dropped (i.e., whose status has chan...
Definition: info.hpp:373
uint64_t m_error_acks_data_count
Of m_received_ack_count, those acknowledgments that contained some error about the sequence numbers s...
Definition: info.hpp:367
std::map< std::type_index, uint64_t > m_low_lvl_packet_xfer_requested_count_by_type
Total count of low-level packets that were given to the sending module to be sent,...
Definition: info.hpp:403
uint64_t m_dropped_data_count
Number of sent DATA packets that are considered permanently dropped (i.e., whose status has changed f...
Definition: info.hpp:378
uint64_t m_received_low_lvl_rcv_wnd_only_ack_count
Of m_received_low_lvl_ack_count, the packets that contained no individual acknowledgments but sent on...
Definition: info.hpp:332
uint64_t m_good_ack_data_size
Of the individual acknowledgments covered by m_received_ack_count, the total bytes in the DATA packet...
Definition: info.hpp:350
uint64_t m_received_low_lvl_ack_count
Number of low-level ACK packets received.
Definition: info.hpp:326
std::map< std::type_index, boost::array< uint64_t, 2 > > m_low_lvl_packet_xfer_called_count_by_type
Count of low-level packets that were given to OS in a send call, from this socket,...
Definition: info.hpp:415
std::map< std::type_index, std::map< Xfer_op_result, uint64_t > > m_low_lvl_packet_xfer_completed_size_by_type_and_result
Of m_low_lvl_packet_xfer_called_size_by_type, the data for which the send completion handler executed...
Definition: info.hpp:421
uint64_t m_remote_rcv_wnd_exhaustion_events
Number of times m_rcv_wnd_exhausted changed from false.
Definition: info.hpp:341
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...
Definition: node.cpp:25
Xfer_op_result
Result of a send or receive operation, used at least in stat reporting.
boost::system::error_code Error_code
Short-hand for a boost.system error code (which basically encapsulates an integer/enum error code and...
Definition: common.hpp:502
Fine_clock::duration Fine_duration
A high-res time duration as computed from two Fine_time_pts.
Definition: common.hpp:410
Fine_clock::time_point Fine_time_pt
A high-res time point as returned by Fine_clock::now() and suitable for precise time math in general.
Definition: common.hpp:407
A set of low-level options affecting a single Flow Node, including Peer_socket objects and other obje...
Definition: options.hpp:449
A data store that keeps stats about the a Peer_socket connection.
Definition: info.hpp:456
Peer_socket_send_stats m_snd
Stats for outgoing direction of traffic. As opposed to the other m_snd_* members, this typically accu...
Definition: info.hpp:511
Node_options m_node_opts
Per-node options currently set on the socket's Node.
Definition: info.hpp:651
size_t m_low_lvl_max_buf_size
The UDP receive buffer maximum size, as reported by an appropriate call to the appropriate getsockopt...
Definition: info.hpp:526
static void output_map_of_pkt_counts(std::ostream *os, const std::map< Key, Value > &count_by_type, const std::map< Key, Value > *size_by_type)
Helper for various output() methods that outputs a one-line representation of a sorted map,...
Definition: info.cpp:408
size_t m_rcv_buf_size
The number of bytes in the internal Receive buffer.
Definition: info.hpp:549
size_t m_rcv_wnd_last_advertised
The last rcv_wnd (receive window) size sent to sender (not necessarily received; packets can be lost)...
Definition: info.hpp:555
Peer_socket_info()
Constructs object by initializing stats to their initial values.
Definition: info.cpp:295
Fine_duration m_snd_pacing_slice_period
In pacing, the duration of the current pacing time slice.
Definition: info.hpp:629
size_t m_rcv_reassembly_q_data_size
If rexmit_on is false then 0; otherwise the total DATA payload in the reassembly queue of the socket.
Definition: info.hpp:558
size_t m_snd_pacing_bytes_allowed_this_slice
This many bytes worth of DATA packets may still be sent, at this time, within the time slice defined ...
Definition: info.hpp:635
flow::Fine_time_pt Fine_time_pt
Short-hand for a fine boost.chrono time point type.
Definition: info.hpp:463
Peer_socket_options m_sock_opts
Per-socket options currently set on the socket.
Definition: info.hpp:644
size_t m_snd_buf_size
The number of bytes in the internal Send buffer.
Definition: info.hpp:590
size_t m_rcv_syn_rcvd_data_cumulative_size
Total size of DATA payload queued while waiting for SYN_ACK_ACK in SYN_RCVD state.
Definition: info.hpp:573
size_t m_rcv_syn_rcvd_data_q_size
Number of DATA packets queued while waiting for SYN_ACK_ACK in SYN_RCVD state.
Definition: info.hpp:576
std::string m_int_state_str
The internal state of the socket, rendered into string (e.g., "SYN_RECEIVED" or "ESTABLISHED").
Definition: info.hpp:533
Fine_time_pt m_snd_pacing_slice_start
In pacing, the time point marking the beginning of the current pacing time slice.
Definition: info.hpp:626
size_t m_snd_cong_ctl_in_flight_count
In congestion control, the current sent data packets that have been neither acknowledged nor consider...
Definition: info.hpp:611
size_t m_snd_cong_ctl_in_flight_bytes
In congestion control, the current sent data bytes that have been neither acknowledged nor considered...
Definition: info.hpp:608
double m_snd_est_bandwidth_mbit_per_sec
Estimate of the currently available (to this connection) outgoing bandwidth, in megabits per second.
Definition: info.hpp:641
size_t m_rcv_wnd
Receive window size = max Receive buffer space minus space taken. Infinity if flow control disabled.
Definition: info.hpp:552
size_t m_rcv_packets_with_gaps
Number of DATA packets tracked in structure tracking all valid received packets such at least one pac...
Definition: info.hpp:570
size_t m_snd_cong_ctl_wnd_bytes
In congestion control, the current congestion window (number of outgoing data bytes allowed In-flight...
Definition: info.hpp:599
Fine_duration m_snd_smoothed_round_trip_time
Estimated current round trip time of packets, computed as a smooth value over the past individual RTT...
Definition: info.hpp:614
Error_code m_disconnect_cause
If the socket is closing or closed, this is the reason for the closure; otherwise the default-constru...
Definition: info.hpp:539
size_t m_snd_cong_ctl_wnd_count_approx
In congestion control, the approximate equivalent of m_snd_cong_ctl_in_flight_bytes as a full packet ...
Definition: info.hpp:602
size_t m_snd_rcv_wnd
The receive window (rcv_wnd a/k/a free Receive buffer space) value of the peer socket on the other si...
Definition: info.hpp:596
static void output_pkt_count_value(std::ostream *os, uint64_t value)
Helper for output_map_of_pkt_counts() that outputs a count or size.
Definition: info.cpp:452
bool m_is_active_connect
true if this is the "client" socket (connect()ed); false otherwise (accept()ed).
Definition: info.hpp:536
size_t m_snd_pacing_packet_q_size
In pacing, number of packets currently queued to be sent out by the pacing module.
Definition: info.hpp:623
static void output_pkt_count_key(std::ostream *os, const std::type_index &type_id)
Helper for output_map_of_pkt_counts() that outputs a raw packet type ID index, namely type_index(type...
Definition: info.cpp:490
void output(std::ostream *os) const
Outputs the current stats, across multiple lines but not ending with a newline, into the given output...
Definition: info.cpp:322
Fine_duration m_snd_round_trip_time_variance
RTTVAR used for m_snd_smoothed_round_trip_time calculation; it is the current RTT variance.
Definition: info.hpp:617
flow::Fine_duration Fine_duration
Short-hand for a fine boost.chrono time duration type.
Definition: info.hpp:460
Peer_socket_receive_stats m_rcv
Stats for incoming direction of traffic. As opposed to the other m_rcv_* members, this typically accu...
Definition: info.hpp:508
Fine_duration m_snd_drop_timeout
Drop Timeout: how long a given packet must remain unacknowledged to be considered dropped due to Drop...
Definition: info.hpp:620
A set of low-level options affecting a single Peer_socket.
Definition: options.hpp:36
A data store that keeps stats about the incoming direction of a Peer_socket connection to another Flo...
Definition: info.hpp:54
uint64_t m_good_data_delivered_size
Of m_good_data_accepted_size, the data that were delivered into Receive buffer (either immediately up...
Definition: info.hpp:102
uint64_t m_rcv_wnd_recovery_success_count
Of m_rcv_wnd_recovery_count, the number of times the recovery was successful: i.e....
Definition: info.hpp:243
uint64_t m_total_data_size
Bytes in DATA packets received on socket.
Definition: info.hpp:78
void output(std::ostream *os) const
Outputs the current stats, across multiple lines but not ending with a newline, into the given output...
Definition: info.cpp:68
uint64_t m_good_to_send_acks_data_size
Of m_total_to_send_acks_data_size, the data that also satisfy the criteria in m_good_data_delivered_s...
Definition: info.hpp:186
uint64_t m_good_data_accepted_size
Of m_good_data_size, the data that were not dropped (so either delivered into Receive buffer or queue...
Definition: info.hpp:91
uint64_t m_late_or_dupe_data_size
Of m_total_data_size, the data that had either already been received before or (more likely) had been...
Definition: info.hpp:156
uint64_t m_rcv_wnd_recovery_timeout_count
Of m_rcv_wnd_recovery_count, the number of times the recovery failed: i.e., resulted in a certain len...
Definition: info.hpp:251
uint64_t m_delayed_acks_count
The total number of individual packet acknowledgments whose sending was delayed (via delayed ACK mech...
Definition: info.hpp:215
uint64_t m_good_to_send_acks_count
Of m_total_to_send_acks_count, the data that also satisfy the criteria in m_good_data_delivered_count...
Definition: info.hpp:191
uint64_t m_total_to_send_acks_count
Number of DATA packets acknowledged thus far or that have been received and are pending to be acknowl...
Definition: info.hpp:179
uint64_t m_total_to_send_acks_data_size
Bytes in received DATA packets acknowledged thus far or that have been received and are pending to be...
Definition: info.hpp:174
uint64_t m_good_data_size
Of m_total_data_size, the data that were new and acceptable into Receive buffer assuming there was sp...
Definition: info.hpp:83
uint64_t m_late_or_dupe_data_count
Of m_total_data_count, the data that had either already been received before or (more likely) had bee...
Definition: info.hpp:161
uint64_t m_sent_individual_acks_count
Number of DATA packets such that for a given packet an individual acknowledgment has been packaged in...
Definition: info.hpp:221
size_t m_max_buf_data_size
Maximum number of bytes in the Receive buffer so far.
Definition: info.hpp:260
uint64_t m_sent_low_lvl_acks_count
Number of low-level ACK packets that have been sent or will be sent as soon as possible.
Definition: info.hpp:224
uint64_t m_good_data_delivered_count
Of m_good_data_accepted_count, the data that were delivered into Receive buffer (either immediately u...
Definition: info.hpp:107
std::map< std::type_index, uint64_t > m_low_lvl_packet_count_by_type
Count of low-level packets received targeted at this socket, split up by packet type similarly to m_l...
Definition: info.hpp:273
uint64_t m_late_or_dupe_to_send_acks_data_size
Of m_total_to_send_acks_data_size, the data that also satisfy the criteria in m_late_or_dupe_data_siz...
Definition: info.hpp:198
uint64_t m_total_data_count
Number of DATA packets received on socket.
Definition: info.hpp:80
uint64_t m_good_data_count
Of m_total_data_count, the data that were new and acceptable into Receive buffer assuming there was s...
Definition: info.hpp:85
size_t m_current_pending_acks_count
Of m_total_to_send_acks_count, the packets that have not yet been sent to the sender (pending acknowl...
Definition: info.hpp:209
uint64_t m_sent_low_lvl_rcv_wnd_only_acks_count
Of m_sent_low_lvl_acks_count, the packets that contained no individual acknowledgments but are to be ...
Definition: info.hpp:257
uint64_t m_good_data_first_qd_size
Of m_good_data_accepted_size, the data that were, upon receipt, queued for reassembly (not immediatel...
Definition: info.hpp:113
uint64_t m_error_data_size
Of m_total_data_size, the data that contained some error about the sequence numbers so that they were...
Definition: info.hpp:145
uint64_t m_good_data_dropped_buf_overflow_size
Of m_good_data_size, the data that were dropped due to insufficient Receive buffer space.
Definition: info.hpp:124
Peer_socket_receive_stats()
Constructs object by initializing stats to their initial values.
Definition: info.cpp:28
uint64_t m_presumed_dropped_data_size
Total number of bytes in hypothetical data packets that have been considered Dropped due to the numbe...
Definition: info.hpp:168
uint64_t m_late_or_dupe_to_send_acks_count
Of m_total_to_send_acks_count, the data that also satisfy the criteria in m_late_or_dupe_data_count.
Definition: info.hpp:203
Fine_time_pt m_init_time
The time this object (or source object from assignment) was made; should be about equal to when socke...
Definition: info.hpp:75
uint64_t m_good_data_accepted_count
Of m_good_data_count, the data that were not dropped (so either delivered into Receive buffer or queu...
Definition: info.hpp:96
uint64_t m_good_data_dropped_reassembly_q_overflow_size
Of m_good_data_size, the data that were dropped due to insufficient Receive reassembly queue space (o...
Definition: info.hpp:134
uint64_t m_error_data_count
Of m_total_data_count, the data that contained some error about the sequence numbers so that they wer...
Definition: info.hpp:150
uint64_t m_rcv_wnd_recovery_count
Number of times we detected (heuristically but fairly reliably) that the following event occurred: ou...
Definition: info.hpp:237
uint64_t m_good_data_dropped_reassembly_q_overflow_count
Of m_good_data_count, the data that were dropped due to insufficient Receive reassembly queue space (...
Definition: info.hpp:139
uint64_t m_good_data_first_qd_count
Of m_good_data_accepted_count, the data that were, upon receipt, queued for reassembly (not immediate...
Definition: info.hpp:118
uint64_t m_good_data_dropped_buf_overflow_count
Of m_good_data_count, the data that were dropped due to insufficient Receive buffer space.
Definition: info.hpp:128
std::map< std::type_index, uint64_t > m_low_lvl_packet_size_by_type
Total size in serialized form of low-level packets received targeted at this socket,...
Definition: info.hpp:267