| // Copyright 2025 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| /// TCP types used across multiple FIDL endpoints. |
| @available(added=NEXT) |
| library fuchsia.net.tcp; |
| |
| /// TCP congestion control state machine state. |
| type CongestionControlState = strict enum { |
| /// No indication of duplicate ACKs or loss. Everything is fine. |
| OPEN = 0; |
| /// Received SACK blocks duplicate ACKs, assumed to be due to packet loss |
| /// or reordering. |
| DISORDER = 1; |
| /// Sending rate reduced due to congestion signal. This is either an ECN or |
| /// local queue overrun. |
| CONGESTION_WINDOW_REDUCED = 2; |
| /// Sender has entered either fast recovery (after seeing enough duplicate |
| /// ACKs) or SACK-based recovery |
| RECOVERY = 3; |
| /// Sender hit RTO and entered slow start. Exits when all retransmitted |
| /// packets have been ACKed. |
| LOSS = 4; |
| }; |
| |
| /// TCP state machine state. |
| type State = strict enum { |
| ESTABLISHED = 1; |
| SYN_SENT = 2; |
| SYN_RECV = 3; |
| FIN_WAIT1 = 4; |
| FIN_WAIT2 = 5; |
| TIME_WAIT = 6; |
| CLOSE = 7; |
| CLOSE_WAIT = 8; |
| LAST_ACK = 9; |
| LISTEN = 10; |
| CLOSING = 11; |
| }; |
| |
| /// TCP protocol state. |
| type Info = table { |
| /// The current state of the TCP state machine. |
| 1: state State; |
| /// The current state of the TCP congention avoidance state machine. |
| 2: ca_state CongestionControlState; |
| // 3: tcpi_retransmits uint8; |
| // 4: tcpi_probes uint8; |
| // 5: tcpi_backoff uint8; |
| // 6: tcpi_options uint8; |
| // 7: ... // tcpi_snd_wscale : 4, |
| // 8: ... // tcpi_rcv_wscale : 4; |
| // 9: ... // tcpi_delivery_rate_app_limited : 1, |
| // 10: ... // tcpi_fastopen_client_fail : 2; |
| /// The current RTO value in microseconds. |
| 11: rto_usec uint32; |
| // 12: tcpi_ato uint32; |
| // 13: tcpi_snd_mss uint32; |
| // 14: tcpi_rcv_mss uint32; |
| // 15: tcpi_unacked uint32; |
| // 16: tcpi_sacked uint32; |
| // 17: tcpi_lost uint32; |
| // 18: tcpi_retrans uint32; |
| // 19: tcpi_fackets uint32; |
| /// Time since data was last sent on the connection in milliseconds. |
| 20: tcpi_last_data_sent_msec uint32; |
| // 21: tcpi_last_ack_sent uint32; |
| // 22: tcpi_last_data_recv uint32; |
| /// Time since the most recent ACK was received in milliseconds. |
| 23: tcpi_last_ack_recv_msec uint32; |
| // 24: tcpi_pmtu uint32; |
| // 25: tcpi_rcv_ssthresh uint32; |
| /// The estimated smoothed roundtrip time in microseconds. |
| 26: rtt_usec uint32; |
| /// The smoothed mean deviation of the roundtrip time in microseconds. |
| 27: rtt_var_usec uint32; |
| /// The sending slow start threshold in segments. |
| 28: snd_ssthresh uint32; |
| /// The current sending congestion window in segments. |
| 29: snd_cwnd uint32; |
| // 30: tcpi_advmss uint32; |
| // 31: tcpi_reordering uint32; |
| // 32: tcpi_rcv_rtt uint32; |
| // 33: tcpi_rcv_space uint32; |
| /// The total number of retransmission events. |
| 34: tcpi_total_retrans uint32; |
| // 35: tcpi_pacing_rate uint64; |
| // 36: tcpi_max_pacing_rate uint64; |
| // 37: tcpi_bytes_acked uint64; |
| // 38: tcpi_bytes_received uint64; |
| /// The total number of segments transmitted. |
| 39: tcpi_segs_out uint64; |
| /// The total number of segments received. |
| 40: tcpi_segs_in uint64; |
| // 41: tcpi_notsent_bytes uint32; |
| // 42: tcpi_min_rtt uint32; |
| // 43: tcpi_data_segs_in uint32; |
| // 44: tcpi_data_segs_out uint32; |
| // 45: tcpi_delivery_rate uint64; |
| // 46: tcpi_busy_time uint64; |
| // 47: tcpi_rwnd_limited uint64; |
| // 48: tcpi_sndbuf_limited uint64; |
| // 49: tcpi_delivered uint32; |
| // 50: tcpi_delivered_ce uint32; |
| // 51: tcpi_bytes_sent uint64; |
| // 52: tcpi_bytes_retrans uint64; |
| // 53: tcpi_dsack_dups uint32; |
| /// Whether the connection thinks it has ever seen reordering. |
| // TODO(https://fxbug.dev/434682660): This is different from Linux, where |
| // this field is the number of reordering events seen. |
| 54: reorder_seen bool; |
| // 55: tcpi_rcv_ooopack uint32; |
| // 56: tcpi_snd_wnd uint32; |
| }; |