FD.io VPP  v19.04-6-g6f05f72
Vector Packet Processing
tcp.h File Reference
+ Include dependency graph for tcp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcp_worker_ctx_
 
struct  tcp_iss_seed_
 

Macros

#define TCP_TICK   0.001
 TCP tick period (s) More...
 
#define THZ   (u32) (1/TCP_TICK)
 TCP tick frequency. More...
 
#define TCP_TSTAMP_RESOLUTION   TCP_TICK
 Time stamp resolution. More...
 
#define TCP_PAWS_IDLE   24 * 24 * 60 * 60 * THZ
 24 days More...
 
#define TCP_FIB_RECHECK_PERIOD   1 * THZ
 Recheck every 1s. More...
 
#define TCP_MAX_OPTION_SPACE   40
 
#define TCP_CC_DATA_SZ   24
 
#define TCP_DUPACK_THRESHOLD   3
 
#define TCP_MAX_RX_FIFO_SIZE   32 << 20
 
#define TCP_MIN_RX_FIFO_SIZE   4 << 10
 
#define TCP_IW_N_SEGMENTS   10
 
#define TCP_ALWAYS_ACK   1
 On/off delayed acks. More...
 
#define TCP_USE_SACKS   1
 Disable only for testing. More...
 
#define foreach_tcp_fsm_state
 TCP FSM state definitions as per RFC793. More...
 
#define foreach_tcp_timer
 TCP timers. More...
 
#define TCP_TIMER_HANDLE_INVALID   ((u32) ~0)
 
#define TCP_TO_TIMER_TICK
 
#define TCP_DELACK_TIME   1 /* 0.1s */
 
#define TCP_ESTABLISH_TIME   750 /* 75s */
 
#define TCP_SYN_RCVD_TIME   600 /* 60s */
 
#define TCP_2MSL_TIME   300 /* 30s */
 
#define TCP_CLOSEWAIT_TIME   20 /* 2s */
 
#define TCP_TIMEWAIT_TIME   100 /* 10s */
 
#define TCP_FINWAIT1_TIME   600 /* 60s */
 
#define TCP_CLEANUP_TIME   1 /* 0.1s */
 
#define TCP_TIMER_PERSIST_MIN   2 /* 0.2s */
 
#define TCP_RTO_MAX   60 * THZ /* Min max RTO (60s) as per RFC6298 */
 
#define TCP_RTO_MIN   0.2 * THZ /* Min RTO (200ms) - lower than standard */
 
#define TCP_RTT_MAX   30 * THZ /* 30s (probably too much) */
 
#define TCP_RTO_SYN_RETRIES   3 /* SYN retries without doubling RTO */
 
#define TCP_RTO_INIT   1 * THZ /* Initial retransmit timer */
 
#define foreach_tcp_connection_flag
 TCP connection flags. More...
 
#define TCP_SCOREBOARD_TRACE   (0)
 
#define TCP_MAX_SACK_BLOCKS   256
 Max number of SACK blocks stored. More...
 
#define TCP_INVALID_SACK_HOLE_INDEX   ((u32)~0)
 
#define tcp_scoreboard_trace_add(_tc, _ack)
 
#define tcp_fastrecovery_on(tc)   (tc)->flags |= TCP_CONN_FAST_RECOVERY
 
#define tcp_fastrecovery_off(tc)   (tc)->flags &= ~TCP_CONN_FAST_RECOVERY
 
#define tcp_recovery_on(tc)   (tc)->flags |= TCP_CONN_RECOVERY
 
#define tcp_recovery_off(tc)   (tc)->flags &= ~TCP_CONN_RECOVERY
 
#define tcp_in_fastrecovery(tc)   ((tc)->flags & TCP_CONN_FAST_RECOVERY)
 
#define tcp_in_recovery(tc)   ((tc)->flags & (TCP_CONN_RECOVERY))
 
#define tcp_in_slowstart(tc)   (tc->cwnd < tc->ssthresh)
 
#define tcp_disconnect_pending(tc)   ((tc)->flags & TCP_CONN_DCNT_PENDING)
 
#define tcp_disconnect_pending_on(tc)   ((tc)->flags |= TCP_CONN_DCNT_PENDING)
 
#define tcp_disconnect_pending_off(tc)   ((tc)->flags &= ~TCP_CONN_DCNT_PENDING)
 
#define tcp_fastrecovery_first(tc)   ((tc)->flags & TCP_CONN_FRXT_FIRST)
 
#define tcp_fastrecovery_first_on(tc)   ((tc)->flags |= TCP_CONN_FRXT_FIRST)
 
#define tcp_fastrecovery_first_off(tc)   ((tc)->flags &= ~TCP_CONN_FRXT_FIRST)
 
#define tcp_in_cong_recovery(tc)
 
#define tcp_error(n, s)   TCP_ERROR_##n,
 
#define tcp_trajectory_add_start(b, start)
 
#define seq_lt(_s1, _s2)   ((i32)((_s1)-(_s2)) < 0)
 
#define seq_leq(_s1, _s2)   ((i32)((_s1)-(_s2)) <= 0)
 
#define seq_gt(_s1, _s2)   ((i32)((_s1)-(_s2)) > 0)
 
#define seq_geq(_s1, _s2)   ((i32)((_s1)-(_s2)) >= 0)
 
#define seq_max(_s1, _s2)   (seq_gt((_s1), (_s2)) ? (_s1) : (_s2))
 
#define timestamp_lt(_t1, _t2)   ((i32)((_t1)-(_t2)) < 0)
 
#define timestamp_leq(_t1, _t2)   ((i32)((_t1)-(_t2)) <= 0)
 
#define tcp_validate_txf_size(_tc, _a)
 

Typedefs

typedef enum _tcp_state tcp_state_t
 
typedef enum _tcp_timers tcp_timers_e
 
typedef void( timer_expiration_handler) (u32 index)
 
typedef enum _tcp_connection_flag_bits tcp_connection_flag_bits_e
 
typedef enum _tcp_connection_flag tcp_connection_flags_e
 
typedef struct _scoreboard_trace_elt scoreboard_trace_elt_t
 
typedef struct _sack_scoreboard_hole sack_scoreboard_hole_t
 
typedef struct _sack_scoreboard sack_scoreboard_t
 
typedef enum _tcp_cc_algorithm_type tcp_cc_algorithm_type_e
 
typedef struct _tcp_cc_algorithm tcp_cc_algorithm_t
 
typedef enum _tcp_cc_ack_t tcp_cc_ack_t
 
typedef struct _tcp_connection tcp_connection_t
 
typedef enum _tcp_error tcp_error_t
 
typedef struct _tcp_lookup_dispatch tcp_lookup_dispatch_t
 
typedef struct tcp_worker_ctx_ tcp_worker_ctx_t
 
typedef struct tcp_iss_seed_ tcp_iss_seed_t
 
typedef struct _tcp_main tcp_main_t
 

Functions

sack_scoreboard_hole_tscoreboard_next_rxt_hole (sack_scoreboard_t *sb, sack_scoreboard_hole_t *start, u8 have_sent_1_smss, u8 *can_rescue, u8 *snd_limited)
 Figure out the next hole to retransmit. More...
 
sack_scoreboard_hole_tscoreboard_get_hole (sack_scoreboard_t *sb, u32 index)
 
sack_scoreboard_hole_tscoreboard_next_hole (sack_scoreboard_t *sb, sack_scoreboard_hole_t *hole)
 
sack_scoreboard_hole_tscoreboard_prev_hole (sack_scoreboard_t *sb, sack_scoreboard_hole_t *hole)
 
sack_scoreboard_hole_tscoreboard_first_hole (sack_scoreboard_t *sb)
 
sack_scoreboard_hole_tscoreboard_last_hole (sack_scoreboard_t *sb)
 
void scoreboard_clear (sack_scoreboard_t *sb)
 
void scoreboard_init (sack_scoreboard_t *sb)
 
u8format_tcp_scoreboard (u8 *s, va_list *args)
 
static void tcp_cong_recovery_off (tcp_connection_t *tc)
 
static tcp_main_tvnet_get_tcp_main ()
 
static tcp_worker_ctx_ttcp_get_worker (u32 thread_index)
 
static tcp_header_ttcp_buffer_hdr (vlib_buffer_t *b)
 
clib_error_tvnet_tcp_enable_disable (vlib_main_t *vm, u8 is_en)
 
void tcp_punt_unknown (vlib_main_t *vm, u8 is_ip4, u8 is_add)
 
static tcp_connection_ttcp_connection_get (u32 conn_index, u32 thread_index)
 
static tcp_connection_ttcp_connection_get_if_valid (u32 conn_index, u32 thread_index)
 
static tcp_connection_ttcp_get_connection_from_transport (transport_connection_t *tconn)
 
static void tcp_connection_set_state (tcp_connection_t *tc, tcp_state_t state)
 
void tcp_connection_close (tcp_connection_t *tc)
 Begin connection closing procedure. More...
 
void tcp_connection_cleanup (tcp_connection_t *tc)
 Cleans up connection state. More...
 
void tcp_connection_del (tcp_connection_t *tc)
 Connection removal. More...
 
int tcp_half_open_connection_cleanup (tcp_connection_t *tc)
 Try to cleanup half-open connection. More...
 
tcp_connection_ttcp_connection_alloc (u8 thread_index)
 
void tcp_connection_free (tcp_connection_t *tc)
 
void tcp_connection_reset (tcp_connection_t *tc)
 Notify session that connection has been reset. More...
 
int tcp_configure_v4_source_address_range (vlib_main_t *vm, ip4_address_t *start, ip4_address_t *end, u32 table_id)
 Configure an ipv4 source address range. More...
 
int tcp_configure_v6_source_address_range (vlib_main_t *vm, ip6_address_t *start, ip6_address_t *end, u32 table_id)
 Configure an ipv6 source address range. More...
 
void tcp_api_reference (void)
 
u8format_tcp_connection (u8 *s, va_list *args)
 
static tcp_connection_ttcp_listener_get (u32 tli)
 
static tcp_connection_ttcp_half_open_connection_get (u32 conn_index)
 
void tcp_make_fin (tcp_connection_t *tc, vlib_buffer_t *b)
 Convert buffer to FIN-ACK. More...
 
void tcp_make_synack (tcp_connection_t *ts, vlib_buffer_t *b)
 Convert buffer to SYN-ACK. More...
 
void tcp_send_reset_w_pkt (tcp_connection_t *tc, vlib_buffer_t *pkt, u32 thread_index, u8 is_ip4)
 Send reset without reusing existing buffer. More...
 
void tcp_send_reset (tcp_connection_t *tc)
 Build and set reset packet for connection. More...
 
void tcp_send_syn (tcp_connection_t *tc)
 Send SYN. More...
 
void tcp_send_synack (tcp_connection_t *tc)
 
void tcp_send_fin (tcp_connection_t *tc)
 Send FIN. More...
 
void tcp_init_mss (tcp_connection_t *tc)
 
void tcp_update_burst_snd_vars (tcp_connection_t *tc)
 Update burst send vars. More...
 
void tcp_update_rto (tcp_connection_t *tc)
 
void tcp_flush_frame_to_output (tcp_worker_ctx_t *wrk, u8 is_ip4)
 Flush tx frame populated by retransmits and timer pops. More...
 
void tcp_flush_frames_to_output (tcp_worker_ctx_t *wrk)
 Flush v4 and v6 tcp and ip-lookup tx frames for thread index. More...
 
void tcp_program_fastretransmit (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 
void tcp_do_fastretransmits (tcp_worker_ctx_t *wrk)
 
void tcp_program_ack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 
void tcp_program_dupack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 
void tcp_send_acks (tcp_worker_ctx_t *wrk)
 
static u32 tcp_end_seq (tcp_header_t *th, u32 len)
 
static u32 tcp_bytes_out (const tcp_connection_t *tc)
 Our estimate of the number of bytes that have left the network. More...
 
static u32 tcp_flight_size (const tcp_connection_t *tc)
 Our estimate of the number of bytes in flight (pipe size) More...
 
static u32 tcp_initial_cwnd (const tcp_connection_t *tc)
 Initial cwnd as per RFC5681. More...
 
static void tcp_cwnd_accumulate (tcp_connection_t *tc, u32 thresh, u32 bytes)
 
static u32 tcp_loss_wnd (const tcp_connection_t *tc)
 
static u32 tcp_available_snd_wnd (const tcp_connection_t *tc)
 
static u32 tcp_available_output_snd_space (const tcp_connection_t *tc)
 
static u32 tcp_available_cc_snd_space (const tcp_connection_t *tc)
 Estimate of how many bytes we can still push into the network. More...
 
static u8 tcp_is_lost_fin (tcp_connection_t *tc)
 
u32 tcp_snd_space (tcp_connection_t *tc)
 
int tcp_retransmit_first_unacked (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 Retransmit first unacked segment. More...
 
int tcp_fast_retransmit_no_sack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Fast retransmit without SACK info. More...
 
int tcp_fast_retransmit_sack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Do fast retransmit with SACKs. More...
 
int tcp_fast_retransmit (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Do fast retransmit. More...
 
void tcp_cc_init_congestion (tcp_connection_t *tc)
 Init loss recovery/fast recovery. More...
 
void tcp_cc_fastrecovery_exit (tcp_connection_t *tc)
 
fib_node_index_t tcp_lookup_rmt_in_fib (tcp_connection_t *tc)
 
void tcp_update_sack_list (tcp_connection_t *tc, u32 start, u32 end)
 Build SACK list as per RFC2018. More...
 
u32 tcp_sack_list_bytes (tcp_connection_t *tc)
 
static u32 tcp_time_now (void)
 
static u32 tcp_time_now_w_thread (u32 thread_index)
 
static f64 tcp_time_now_us (u32 thread_index)
 
static u32 tcp_set_time_now (tcp_worker_ctx_t *wrk)
 
u32 tcp_session_push_header (transport_connection_t *tconn, vlib_buffer_t *b)
 
void tcp_connection_timers_init (tcp_connection_t *tc)
 Initialize all connection timers as invalid. More...
 
void tcp_connection_timers_reset (tcp_connection_t *tc)
 Stop all connection timers. More...
 
void tcp_init_snd_vars (tcp_connection_t *tc)
 Initialize connection send variables. More...
 
void tcp_connection_init_vars (tcp_connection_t *tc)
 Initialize tcp connection variables. More...
 
void tcp_connection_tx_pacer_update (tcp_connection_t *tc)
 
void tcp_connection_tx_pacer_reset (tcp_connection_t *tc, u32 window, u32 start_bucket)
 
static void tcp_cc_rcv_ack (tcp_connection_t *tc)
 
static void tcp_timer_set (tcp_connection_t *tc, u8 timer_id, u32 interval)
 
static void tcp_timer_reset (tcp_connection_t *tc, u8 timer_id)
 
static void tcp_timer_update (tcp_connection_t *tc, u8 timer_id, u32 interval)
 
static void tcp_retransmit_timer_set (tcp_connection_t *tc)
 
static void tcp_retransmit_timer_reset (tcp_connection_t *tc)
 
static void tcp_retransmit_timer_force_update (tcp_connection_t *tc)
 
static void tcp_persist_timer_set (tcp_connection_t *tc)
 
static void tcp_persist_timer_update (tcp_connection_t *tc)
 
static void tcp_persist_timer_reset (tcp_connection_t *tc)
 
static void tcp_retransmit_timer_update (tcp_connection_t *tc)
 
static u8 tcp_timer_is_active (tcp_connection_t *tc, tcp_timers_e timer)
 
void tcp_rcv_sacks (tcp_connection_t *tc, u32 ack)
 
u8tcp_scoreboard_replay (u8 *s, tcp_connection_t *tc, u8 verbose)
 
void tcp_cc_algo_register (tcp_cc_algorithm_type_e type, const tcp_cc_algorithm_t *vft)
 
tcp_cc_algorithm_ttcp_cc_algo_get (tcp_cc_algorithm_type_e type)
 
static void * tcp_cc_data (tcp_connection_t *tc)
 
void newreno_rcv_cong_ack (tcp_connection_t *tc, tcp_cc_ack_t ack_type)
 
static void * vlib_buffer_push_tcp_net_order (vlib_buffer_t *b, u16 sp, u16 dp, u32 seq, u32 ack, u8 tcp_hdr_opts_len, u8 flags, u16 wnd)
 Push TCP header to buffer. More...
 
static void * vlib_buffer_push_tcp (vlib_buffer_t *b, u16 sp_net, u16 dp_net, u32 seq, u32 ack, u8 tcp_hdr_opts_len, u8 flags, u16 wnd)
 Push TCP header to buffer. More...
 

Variables

format_function_t format_tcp_state
 
format_function_t format_tcp_flags
 
format_function_t format_tcp_sacks
 
format_function_t format_tcp_rcv_sacks
 
timer_expiration_handler tcp_timer_delack_handler
 
timer_expiration_handler tcp_timer_retransmit_handler
 
timer_expiration_handler tcp_timer_persist_handler
 
timer_expiration_handler tcp_timer_retransmit_syn_handler
 
tcp_main_t tcp_main
 
vlib_node_registration_t tcp4_input_node
 (constructor) VLIB_REGISTER_NODE (tcp4_input_node) More...
 
vlib_node_registration_t tcp6_input_node
 (constructor) VLIB_REGISTER_NODE (tcp6_input_node) More...
 
vlib_node_registration_t tcp4_output_node
 (constructor) VLIB_REGISTER_NODE (tcp4_output_node) More...
 
vlib_node_registration_t tcp6_output_node
 (constructor) VLIB_REGISTER_NODE (tcp6_output_node) More...
 
vlib_node_registration_t tcp4_established_node
 (constructor) VLIB_REGISTER_NODE (tcp4_established_node) More...
 
vlib_node_registration_t tcp6_established_node
 (constructor) VLIB_REGISTER_NODE (tcp6_established_node) More...
 
vlib_node_registration_t tcp4_syn_sent_node
 (constructor) VLIB_REGISTER_NODE (tcp4_syn_sent_node) More...
 
vlib_node_registration_t tcp6_syn_sent_node
 (constructor) VLIB_REGISTER_NODE (tcp6_syn_sent_node) More...
 
vlib_node_registration_t tcp4_rcv_process_node
 (constructor) VLIB_REGISTER_NODE (tcp4_rcv_process_node) More...
 
vlib_node_registration_t tcp6_rcv_process_node
 (constructor) VLIB_REGISTER_NODE (tcp6_rcv_process_node) More...
 
vlib_node_registration_t tcp4_listen_node
 (constructor) VLIB_REGISTER_NODE (tcp4_listen_node) More...
 
vlib_node_registration_t tcp6_listen_node
 (constructor) VLIB_REGISTER_NODE (tcp6_listen_node) More...
 

Macro Definition Documentation

#define foreach_tcp_connection_flag
Value:
_(SNDACK, "Send ACK") \
_(FINSNT, "FIN sent") \
_(RECOVERY, "Recovery") \
_(FAST_RECOVERY, "Fast Recovery") \
_(DCNT_PENDING, "Disconnect pending") \
_(HALF_OPEN_DONE, "Half-open completed") \
_(FINPNDG, "FIN pending") \
_(FRXT_PENDING, "Fast-retransmit pending") \
_(FRXT_FIRST, "Fast-retransmit first again") \
_(DEQ_PENDING, "Pending dequeue acked") \
_(PSH_PENDING, "PSH pending") \
_(FINRCVD, "FIN received") \

TCP connection flags.

Definition at line 117 of file tcp.h.

#define foreach_tcp_fsm_state
Value:
_(CLOSED, "CLOSED") \
_(LISTEN, "LISTEN") \
_(SYN_SENT, "SYN_SENT") \
_(SYN_RCVD, "SYN_RCVD") \
_(ESTABLISHED, "ESTABLISHED") \
_(CLOSE_WAIT, "CLOSE_WAIT") \
_(FIN_WAIT_1, "FIN_WAIT_1") \
_(LAST_ACK, "LAST_ACK") \
_(CLOSING, "CLOSING") \
_(FIN_WAIT_2, "FIN_WAIT_2") \
_(TIME_WAIT, "TIME_WAIT")

TCP FSM state definitions as per RFC793.

Definition at line 43 of file tcp.h.

#define foreach_tcp_timer
Value:
_(RETRANSMIT, "RETRANSMIT") \
_(DELACK, "DELAYED ACK") \
_(PERSIST, "PERSIST") \
_(KEEP, "KEEP") \
_(WAITCLOSE, "WAIT CLOSE") \
_(RETRANSMIT_SYN, "RETRANSMIT SYN") \
_(ESTABLISH, "ESTABLISH") \
_(ESTABLISH_AO, "ESTABLISH_AO") \

TCP timers.

Definition at line 70 of file tcp.h.

#define seq_geq (   _s1,
  _s2 
)    ((i32)((_s1)-(_s2)) >= 0)

Definition at line 642 of file tcp.h.

#define seq_gt (   _s1,
  _s2 
)    ((i32)((_s1)-(_s2)) > 0)

Definition at line 641 of file tcp.h.

#define seq_leq (   _s1,
  _s2 
)    ((i32)((_s1)-(_s2)) <= 0)

Definition at line 640 of file tcp.h.

#define seq_lt (   _s1,
  _s2 
)    ((i32)((_s1)-(_s2)) < 0)

Definition at line 639 of file tcp.h.

#define seq_max (   _s1,
  _s2 
)    (seq_gt((_s1), (_s2)) ? (_s1) : (_s2))

Definition at line 643 of file tcp.h.

#define TCP_2MSL_TIME   300 /* 30s */

Definition at line 103 of file tcp.h.

#define TCP_ALWAYS_ACK   1

On/off delayed acks.

Definition at line 39 of file tcp.h.

#define TCP_CC_DATA_SZ   24

Definition at line 33 of file tcp.h.

#define TCP_CLEANUP_TIME   1 /* 0.1s */

Definition at line 107 of file tcp.h.

#define TCP_CLOSEWAIT_TIME   20 /* 2s */

Definition at line 104 of file tcp.h.

#define TCP_DELACK_TIME   1 /* 0.1s */

Definition at line 100 of file tcp.h.

#define tcp_disconnect_pending (   tc)    ((tc)->flags & TCP_CONN_DCNT_PENDING)

Definition at line 346 of file tcp.h.

#define tcp_disconnect_pending_off (   tc)    ((tc)->flags &= ~TCP_CONN_DCNT_PENDING)

Definition at line 348 of file tcp.h.

#define tcp_disconnect_pending_on (   tc)    ((tc)->flags |= TCP_CONN_DCNT_PENDING)

Definition at line 347 of file tcp.h.

#define TCP_DUPACK_THRESHOLD   3

Definition at line 35 of file tcp.h.

#define tcp_error (   n,
 
)    TCP_ERROR_##n,

Definition at line 365 of file tcp.h.

#define TCP_ESTABLISH_TIME   750 /* 75s */

Definition at line 101 of file tcp.h.

#define tcp_fastrecovery_first (   tc)    ((tc)->flags & TCP_CONN_FRXT_FIRST)

Definition at line 349 of file tcp.h.

#define tcp_fastrecovery_first_off (   tc)    ((tc)->flags &= ~TCP_CONN_FRXT_FIRST)

Definition at line 351 of file tcp.h.

#define tcp_fastrecovery_first_on (   tc)    ((tc)->flags |= TCP_CONN_FRXT_FIRST)

Definition at line 350 of file tcp.h.

#define tcp_fastrecovery_off (   tc)    (tc)->flags &= ~TCP_CONN_FAST_RECOVERY

Definition at line 340 of file tcp.h.

#define tcp_fastrecovery_on (   tc)    (tc)->flags |= TCP_CONN_FAST_RECOVERY

Definition at line 339 of file tcp.h.

#define TCP_FIB_RECHECK_PERIOD   1 * THZ

Recheck every 1s.

Definition at line 31 of file tcp.h.

#define TCP_FINWAIT1_TIME   600 /* 60s */

Definition at line 106 of file tcp.h.

#define tcp_in_cong_recovery (   tc)
Value:
((tc)->flags & \
(TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY))
u32 flags
Definition: vhost_user.h:115

Definition at line 353 of file tcp.h.

#define tcp_in_fastrecovery (   tc)    ((tc)->flags & TCP_CONN_FAST_RECOVERY)

Definition at line 343 of file tcp.h.

#define tcp_in_recovery (   tc)    ((tc)->flags & (TCP_CONN_RECOVERY))

Definition at line 344 of file tcp.h.

#define tcp_in_slowstart (   tc)    (tc->cwnd < tc->ssthresh)

Definition at line 345 of file tcp.h.

#define TCP_INVALID_SACK_HOLE_INDEX   ((u32)~0)

Definition at line 149 of file tcp.h.

#define TCP_IW_N_SEGMENTS   10

Definition at line 38 of file tcp.h.

#define TCP_MAX_OPTION_SPACE   40

Definition at line 32 of file tcp.h.

#define TCP_MAX_RX_FIFO_SIZE   32 << 20

Definition at line 36 of file tcp.h.

#define TCP_MAX_SACK_BLOCKS   256

Max number of SACK blocks stored.

Definition at line 148 of file tcp.h.

#define TCP_MIN_RX_FIFO_SIZE   4 << 10

Definition at line 37 of file tcp.h.

#define TCP_PAWS_IDLE   24 * 24 * 60 * 60 * THZ

24 days

Definition at line 30 of file tcp.h.

#define tcp_recovery_off (   tc)    (tc)->flags &= ~TCP_CONN_RECOVERY

Definition at line 342 of file tcp.h.

#define tcp_recovery_on (   tc)    (tc)->flags |= TCP_CONN_RECOVERY

Definition at line 341 of file tcp.h.

#define TCP_RTO_INIT   1 * THZ /* Initial retransmit timer */

Definition at line 114 of file tcp.h.

#define TCP_RTO_MAX   60 * THZ /* Min max RTO (60s) as per RFC6298 */

Definition at line 110 of file tcp.h.

#define TCP_RTO_MIN   0.2 * THZ /* Min RTO (200ms) - lower than standard */

Definition at line 111 of file tcp.h.

#define TCP_RTO_SYN_RETRIES   3 /* SYN retries without doubling RTO */

Definition at line 113 of file tcp.h.

#define TCP_RTT_MAX   30 * THZ /* 30s (probably too much) */

Definition at line 112 of file tcp.h.

#define TCP_SCOREBOARD_TRACE   (0)

Definition at line 147 of file tcp.h.

#define tcp_scoreboard_trace_add (   _tc,
  _ack 
)

Definition at line 212 of file tcp.h.

#define TCP_SYN_RCVD_TIME   600 /* 60s */

Definition at line 102 of file tcp.h.

#define TCP_TICK   0.001

TCP tick period (s)

Definition at line 27 of file tcp.h.

#define TCP_TIMER_HANDLE_INVALID   ((u32) ~0)

Definition at line 95 of file tcp.h.

#define TCP_TIMER_PERSIST_MIN   2 /* 0.2s */

Definition at line 108 of file tcp.h.

#define TCP_TIMEWAIT_TIME   100 /* 10s */

Definition at line 105 of file tcp.h.

#define TCP_TO_TIMER_TICK
Value:
TCP_TICK*10 /* Period for converting from TCP
* ticks to timer units */
#define TCP_TICK
TCP tick period (s)
Definition: tcp.h:27

Definition at line 98 of file tcp.h.

#define tcp_trajectory_add_start (   b,
  start 
)

Definition at line 539 of file tcp.h.

#define TCP_TSTAMP_RESOLUTION   TCP_TICK

Time stamp resolution.

Definition at line 29 of file tcp.h.

#define TCP_USE_SACKS   1

Disable only for testing.

Definition at line 40 of file tcp.h.

#define tcp_validate_txf_size (   _tc,
  _a 
)
Value:
ASSERT(_tc->state != TCP_STATE_ESTABLISHED \
|| transport_max_tx_dequeue (&_tc->connection) >= _a)
static u32 transport_max_tx_dequeue(transport_connection_t *tc)
Definition: session.h:385
#define ASSERT(truth)

Definition at line 930 of file tcp.h.

#define THZ   (u32) (1/TCP_TICK)

TCP tick frequency.

Definition at line 28 of file tcp.h.

#define timestamp_leq (   _t1,
  _t2 
)    ((i32)((_t1)-(_t2)) <= 0)

Definition at line 647 of file tcp.h.

#define timestamp_lt (   _t1,
  _t2 
)    ((i32)((_t1)-(_t2)) < 0)

Definition at line 646 of file tcp.h.

Typedef Documentation

typedef struct _sack_scoreboard_hole sack_scoreboard_hole_t
typedef struct _sack_scoreboard sack_scoreboard_t
typedef struct _scoreboard_trace_elt scoreboard_trace_elt_t
typedef enum _tcp_cc_ack_t tcp_cc_ack_t
typedef struct _tcp_cc_algorithm tcp_cc_algorithm_t

Definition at line 239 of file tcp.h.

typedef enum _tcp_cc_algorithm_type tcp_cc_algorithm_type_e
typedef enum _tcp_connection_flag_bits tcp_connection_flag_bits_e
typedef enum _tcp_connection_flag tcp_connection_flags_e
typedef struct _tcp_connection tcp_connection_t
typedef enum _tcp_error tcp_error_t
typedef struct tcp_iss_seed_ tcp_iss_seed_t
typedef struct _tcp_lookup_dispatch tcp_lookup_dispatch_t
typedef struct _tcp_main tcp_main_t
typedef enum _tcp_state tcp_state_t
typedef enum _tcp_timers tcp_timers_e
typedef void( timer_expiration_handler) (u32 index)

Definition at line 88 of file tcp.h.

Function Documentation

u8* format_tcp_connection ( u8 s,
va_list *  args 
)

Definition at line 906 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_tcp_scoreboard ( u8 s,
va_list *  args 
)

Definition at line 1021 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void newreno_rcv_cong_ack ( tcp_connection_t tc,
tcp_cc_ack_t  ack_type 
)

Definition at line 45 of file tcp_newreno.c.

+ Here is the caller graph for this function:

void scoreboard_clear ( sack_scoreboard_t sb)

Definition at line 900 of file tcp_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_first_hole ( sack_scoreboard_t sb)

Definition at line 682 of file tcp_input.c.

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_get_hole ( sack_scoreboard_t sb,
u32  index 
)

Definition at line 658 of file tcp_input.c.

+ Here is the caller graph for this function:

void scoreboard_init ( sack_scoreboard_t sb)

Definition at line 892 of file tcp_input.c.

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_last_hole ( sack_scoreboard_t sb)

Definition at line 690 of file tcp_input.c.

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_next_hole ( sack_scoreboard_t sb,
sack_scoreboard_hole_t hole 
)

Definition at line 666 of file tcp_input.c.

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_next_rxt_hole ( sack_scoreboard_t sb,
sack_scoreboard_hole_t start,
u8  have_unsent,
u8 can_rescue,
u8 snd_limited 
)

Figure out the next hole to retransmit.

Follows logic proposed in RFC6675 Sec. 4, NextSeg()

Definition at line 822 of file tcp_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

sack_scoreboard_hole_t* scoreboard_prev_hole ( sack_scoreboard_t sb,
sack_scoreboard_hole_t hole 
)

Definition at line 674 of file tcp_input.c.

+ Here is the caller graph for this function:

void tcp_api_reference ( void  )

Definition at line 109 of file tcp_api.c.

+ Here is the caller graph for this function:

static u32 tcp_available_cc_snd_space ( const tcp_connection_t tc)
inlinestatic

Estimate of how many bytes we can still push into the network.

Definition at line 747 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_available_output_snd_space ( const tcp_connection_t tc)
inlinestatic

Definition at line 732 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_available_snd_wnd ( const tcp_connection_t tc)
inlinestatic

Definition at line 726 of file tcp.h.

+ Here is the caller graph for this function:

static tcp_header_t* tcp_buffer_hdr ( vlib_buffer_t b)
inlinestatic

Definition at line 526 of file tcp.h.

+ Here is the caller graph for this function:

static u32 tcp_bytes_out ( const tcp_connection_t tc)
inlinestatic

Our estimate of the number of bytes that have left the network.

Definition at line 653 of file tcp.h.

+ Here is the caller graph for this function:

tcp_cc_algorithm_t* tcp_cc_algo_get ( tcp_cc_algorithm_type_e  type)

Definition at line 567 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_cc_algo_register ( tcp_cc_algorithm_type_e  type,
const tcp_cc_algorithm_t vft 
)

Definition at line 556 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* tcp_cc_data ( tcp_connection_t tc)
inlinestatic

Definition at line 943 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_cc_fastrecovery_exit ( tcp_connection_t tc)

Definition at line 1187 of file tcp_input.c.

+ Here is the caller graph for this function:

void tcp_cc_init_congestion ( tcp_connection_t tc)

Init loss recovery/fast recovery.

Triggered by dup acks as opposed to timer timeout. Note that cwnd is updated in tcp_cc_handle_event after fast retransmit

Definition at line 1161 of file tcp_input.c.

+ Here is the caller graph for this function:

static void tcp_cc_rcv_ack ( tcp_connection_t tc)
inlinestatic

Definition at line 821 of file tcp.h.

+ Here is the caller graph for this function:

int tcp_configure_v4_source_address_range ( vlib_main_t vm,
ip4_address_t start,
ip4_address_t end,
u32  table_id 
)

Configure an ipv4 source address range.

Parameters
vmvlib_main_t pointer
startfirst ipv4 address in the source address range
endlast ipv4 address in the source address range
table_idVRF / table ID, 0 for the default FIB
Returns
0 if all OK, else an error indication from api_errno.h

Definition at line 1649 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_configure_v6_source_address_range ( vlib_main_t vm,
ip6_address_t start,
ip6_address_t end,
u32  table_id 
)

Configure an ipv6 source address range.

Parameters
vmvlib_main_t pointer
startfirst ipv6 address in the source address range
endlast ipv6 address in the source address range
table_idVRF / table ID, 0 for the default FIB
Returns
0 if all OK, else an error indication from api_errno.h

Definition at line 1741 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_cong_recovery_off ( tcp_connection_t tc)
inlinestatic

Definition at line 357 of file tcp.h.

+ Here is the caller graph for this function:

tcp_connection_t* tcp_connection_alloc ( u8  thread_index)

Definition at line 253 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_cleanup ( tcp_connection_t tc)

Cleans up connection state.

No notifications.

Definition at line 199 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_close ( tcp_connection_t tc)

Begin connection closing procedure.

If at the end the connection is not in CLOSED state, it is not removed. Instead, we rely on on TCP to advance through state machine to either 1) LAST_ACK (passive close) whereby when the last ACK is received tcp_connection_del is called. This notifies session of the delete and calls cleanup. 2) TIME_WAIT (active close) whereby after 2MSL the 2MSL timer triggers and cleanup is called.

N.B. Half-close connections are not supported

Definition at line 340 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_del ( tcp_connection_t tc)

Connection removal.

This should be called only once connection enters CLOSED state. Note that it notifies the session of the removal event, so if the goal is to just remove the connection, call tcp_connection_cleanup instead.

Definition at line 246 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_free ( tcp_connection_t tc)

Definition at line 266 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tcp_connection_t* tcp_connection_get ( u32  conn_index,
u32  thread_index 
)
inlinestatic

Definition at line 547 of file tcp.h.

+ Here is the caller graph for this function:

static tcp_connection_t* tcp_connection_get_if_valid ( u32  conn_index,
u32  thread_index 
)
inlinestatic

Definition at line 556 of file tcp.h.

+ Here is the caller graph for this function:

void tcp_connection_init_vars ( tcp_connection_t tc)

Initialize tcp connection variables.

Should be called after having received a msg from the peer, i.e., a SYN or a SYNACK, such that connection options have already been exchanged.

Definition at line 631 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_reset ( tcp_connection_t tc)

Notify session that connection has been reset.

Switch state to closed and wait for session to call cleanup.

Definition at line 284 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_connection_set_state ( tcp_connection_t tc,
tcp_state_t  state 
)
inlinestatic

Definition at line 572 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_timers_init ( tcp_connection_t tc)

Initialize all connection timers as invalid.

Definition at line 425 of file tcp.c.

+ Here is the caller graph for this function:

void tcp_connection_timers_reset ( tcp_connection_t tc)

Stop all connection timers.

Definition at line 442 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_tx_pacer_reset ( tcp_connection_t tc,
u32  window,
u32  start_bucket 
)

Definition at line 1229 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_connection_tx_pacer_update ( tcp_connection_t tc)

Definition at line 1213 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_cwnd_accumulate ( tcp_connection_t tc,
u32  thresh,
u32  bytes 
)
inlinestatic

Definition at line 707 of file tcp.h.

+ Here is the caller graph for this function:

void tcp_do_fastretransmits ( tcp_worker_ctx_t wrk)

Definition at line 1311 of file tcp_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_end_seq ( tcp_header_t th,
u32  len 
)
inlinestatic

Definition at line 633 of file tcp.h.

int tcp_fast_retransmit ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Do fast retransmit.

Definition at line 1947 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_fast_retransmit_no_sack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Fast retransmit without SACK info.

Definition at line 1883 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_fast_retransmit_sack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Do fast retransmit with SACKs.

Definition at line 1780 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_flight_size ( const tcp_connection_t tc)
inlinestatic

Our estimate of the number of bytes in flight (pipe size)

Definition at line 665 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_flush_frame_to_output ( tcp_worker_ctx_t wrk,
u8  is_ip4 
)

Flush tx frame populated by retransmits and timer pops.

Definition at line 982 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_flush_frames_to_output ( tcp_worker_ctx_t wrk)

Flush v4 and v6 tcp and ip-lookup tx frames for thread index.

Definition at line 1013 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tcp_connection_t* tcp_get_connection_from_transport ( transport_connection_t tconn)
inlinestatic

Definition at line 566 of file tcp.h.

+ Here is the caller graph for this function:

static tcp_worker_ctx_t* tcp_get_worker ( u32  thread_index)
inlinestatic

Definition at line 520 of file tcp.h.

+ Here is the caller graph for this function:

int tcp_half_open_connection_cleanup ( tcp_connection_t tc)

Try to cleanup half-open connection.

If called from a thread that doesn't own tc, the call won't have any effect.

Parameters
tc- connection to be cleaned up
Returns
non-zero if cleanup failed.

Definition at line 170 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tcp_connection_t* tcp_half_open_connection_get ( u32  conn_index)
inlinestatic

Definition at line 601 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_init_mss ( tcp_connection_t tc)

Definition at line 428 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_init_snd_vars ( tcp_connection_t tc)

Initialize connection send variables.

Definition at line 598 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_initial_cwnd ( const tcp_connection_t tc)
inlinestatic

Initial cwnd as per RFC5681.

Definition at line 690 of file tcp.h.

+ Here is the caller graph for this function:

static u8 tcp_is_lost_fin ( tcp_connection_t tc)
inlinestatic

Definition at line 759 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tcp_connection_t* tcp_listener_get ( u32  tli)
inlinestatic

Definition at line 595 of file tcp.h.

+ Here is the caller graph for this function:

fib_node_index_t tcp_lookup_rmt_in_fib ( tcp_connection_t tc)

+ Here is the caller graph for this function:

static u32 tcp_loss_wnd ( const tcp_connection_t tc)
inlinestatic

Definition at line 720 of file tcp.h.

+ Here is the caller graph for this function:

void tcp_make_fin ( tcp_connection_t tc,
vlib_buffer_t b 
)

Convert buffer to FIN-ACK.

Definition at line 522 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_make_synack ( tcp_connection_t ts,
vlib_buffer_t b 
)

Convert buffer to SYN-ACK.

Definition at line 556 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_persist_timer_reset ( tcp_connection_t tc)
inlinestatic

Definition at line 905 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_persist_timer_set ( tcp_connection_t tc)
inlinestatic

Definition at line 888 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_persist_timer_update ( tcp_connection_t tc)
inlinestatic

Definition at line 897 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_program_ack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Definition at line 1171 of file tcp_output.c.

+ Here is the caller graph for this function:

void tcp_program_dupack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Definition at line 1181 of file tcp_output.c.

+ Here is the caller graph for this function:

void tcp_program_fastretransmit ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Definition at line 1301 of file tcp_input.c.

+ Here is the caller graph for this function:

void tcp_punt_unknown ( vlib_main_t vm,
u8  is_ip4,
u8  is_add 
)

Definition at line 1516 of file tcp.c.

+ Here is the caller graph for this function:

void tcp_rcv_sacks ( tcp_connection_t tc,
u32  ack 
)

Definition at line 937 of file tcp_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_retransmit_first_unacked ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Retransmit first unacked segment.

Definition at line 1726 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_retransmit_timer_force_update ( tcp_connection_t tc)
inlinestatic

Definition at line 881 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_retransmit_timer_reset ( tcp_connection_t tc)
inlinestatic

Definition at line 875 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_retransmit_timer_set ( tcp_connection_t tc)
inlinestatic

Definition at line 867 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_retransmit_timer_update ( tcp_connection_t tc)
inlinestatic

Definition at line 911 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tcp_sack_list_bytes ( tcp_connection_t tc)

Definition at line 1781 of file tcp_input.c.

+ Here is the caller graph for this function:

u8* tcp_scoreboard_replay ( u8 s,
tcp_connection_t tc,
u8  verbose 
)

Definition at line 1965 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_acks ( tcp_worker_ctx_t wrk)

Definition at line 1193 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_fin ( tcp_connection_t tc)

Send FIN.

Definition at line 1025 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_reset ( tcp_connection_t tc)

Build and set reset packet for connection.

Definition at line 841 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_reset_w_pkt ( tcp_connection_t tc,
vlib_buffer_t pkt,
u32  thread_index,
u8  is_ip4 
)

Send reset without reusing existing buffer.

It extracts connection info out of original packet

Definition at line 761 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_syn ( tcp_connection_t tc)

Send SYN.

Builds a SYN packet for a half-open connection and sends it to ipx_lookup. The packet is not forwarded through tcpx_output to avoid doing lookups in the half_open pool.

Definition at line 919 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_synack ( tcp_connection_t tc)

Definition at line 955 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tcp_session_push_header ( transport_connection_t tconn,
vlib_buffer_t b 
)

Definition at line 1129 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_set_time_now ( tcp_worker_ctx_t wrk)
inlinestatic

Definition at line 803 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tcp_snd_space ( tcp_connection_t tc)

Definition at line 1141 of file tcp.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_time_now ( void  )
inlinestatic

Definition at line 785 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static f64 tcp_time_now_us ( u32  thread_index)
inlinestatic

Definition at line 797 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_time_now_w_thread ( u32  thread_index)
inlinestatic

Definition at line 791 of file tcp.h.

+ Here is the caller graph for this function:

static u8 tcp_timer_is_active ( tcp_connection_t tc,
tcp_timers_e  timer 
)
inlinestatic

Definition at line 925 of file tcp.h.

+ Here is the caller graph for this function:

static void tcp_timer_reset ( tcp_connection_t tc,
u8  timer_id 
)
inlinestatic

Definition at line 839 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_timer_set ( tcp_connection_t tc,
u8  timer_id,
u32  interval 
)
inlinestatic

Definition at line 828 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_timer_update ( tcp_connection_t tc,
u8  timer_id,
u32  interval 
)
inlinestatic

Definition at line 852 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_update_burst_snd_vars ( tcp_connection_t tc)

Update burst send vars.

  • Updates snd_mss to reflect the effective segment size that we can send by taking into account all TCP options, including SACKs.
  • Cache 'on the wire' options for reuse
  • Updates receive window which can be reused for a burst.

This should only be called when doing bursts

Definition at line 408 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_update_rto ( tcp_connection_t tc)

Definition at line 465 of file tcp_input.c.

+ Here is the caller graph for this function:

void tcp_update_sack_list ( tcp_connection_t tc,
u32  start,
u32  end 
)

Build SACK list as per RFC2018.

Makes sure the first block contains the segment that generated the current ACK and the following ones are the ones most recently reported in SACK blocks.

Parameters
tcTCP connection for which the SACK list is updated
startStart sequence number of the newest SACK block
endEnd sequence of the newest SACK block

Definition at line 1732 of file tcp_input.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vlib_buffer_push_tcp ( vlib_buffer_t b,
u16  sp_net,
u16  dp_net,
u32  seq,
u32  ack,
u8  tcp_hdr_opts_len,
u8  flags,
u16  wnd 
)
inlinestatic

Push TCP header to buffer.

Parameters
b- buffer to write the header to
sp_net- source port net order
dp_net- destination port net order
seq- sequence number host order
ack- ack number host order
tcp_hdr_opts_len- header and options length in bytes
flags- header flags
wnd- window size
Returns
- pointer to start of TCP header

Definition at line 1001 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* vlib_buffer_push_tcp_net_order ( vlib_buffer_t b,
u16  sp,
u16  dp,
u32  seq,
u32  ack,
u8  tcp_hdr_opts_len,
u8  flags,
u16  wnd 
)
inlinestatic

Push TCP header to buffer.

Parameters
vm- vlib_main
b- buffer to write the header to
sp_net- source port net order
dp_net- destination port net order
seq- sequence number net order
ack- ack number net order
tcp_hdr_opts_len- header and options length in bytes
flags- header flags
wnd- window size
Returns
- pointer to start of TCP header

Definition at line 966 of file tcp.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static tcp_main_t* vnet_get_tcp_main ( )
inlinestatic

Definition at line 514 of file tcp.h.

+ Here is the caller graph for this function:

clib_error_t* vnet_tcp_enable_disable ( vlib_main_t vm,
u8  is_en 
)

Definition at line 1498 of file tcp.c.

+ Here is the call graph for this function:

Variable Documentation

format_function_t format_tcp_flags

Definition at line 65 of file tcp.h.

format_function_t format_tcp_rcv_sacks

Definition at line 67 of file tcp.h.

format_function_t format_tcp_sacks

Definition at line 66 of file tcp.h.

format_function_t format_tcp_state

Definition at line 64 of file tcp.h.

vlib_node_registration_t tcp4_established_node

(constructor) VLIB_REGISTER_NODE (tcp4_established_node)

Definition at line 2228 of file tcp_input.c.

vlib_node_registration_t tcp4_input_node

(constructor) VLIB_REGISTER_NODE (tcp4_input_node)

Definition at line 3572 of file tcp_input.c.

vlib_node_registration_t tcp4_listen_node

(constructor) VLIB_REGISTER_NODE (tcp4_listen_node)

Definition at line 3234 of file tcp_input.c.

vlib_node_registration_t tcp4_output_node

(constructor) VLIB_REGISTER_NODE (tcp4_output_node)

Definition at line 2154 of file tcp_output.c.

vlib_node_registration_t tcp4_rcv_process_node

(constructor) VLIB_REGISTER_NODE (tcp4_rcv_process_node)

Definition at line 3031 of file tcp_input.c.

vlib_node_registration_t tcp4_syn_sent_node

(constructor) VLIB_REGISTER_NODE (tcp4_syn_sent_node)

Definition at line 2613 of file tcp_input.c.

vlib_node_registration_t tcp6_established_node

(constructor) VLIB_REGISTER_NODE (tcp6_established_node)

Definition at line 2247 of file tcp_input.c.

vlib_node_registration_t tcp6_input_node

(constructor) VLIB_REGISTER_NODE (tcp6_input_node)

Definition at line 3592 of file tcp_input.c.

vlib_node_registration_t tcp6_listen_node

(constructor) VLIB_REGISTER_NODE (tcp6_listen_node)

Definition at line 3253 of file tcp_input.c.

vlib_node_registration_t tcp6_output_node

(constructor) VLIB_REGISTER_NODE (tcp6_output_node)

Definition at line 2174 of file tcp_output.c.

vlib_node_registration_t tcp6_rcv_process_node

(constructor) VLIB_REGISTER_NODE (tcp6_rcv_process_node)

Definition at line 3050 of file tcp_input.c.

vlib_node_registration_t tcp6_syn_sent_node

(constructor) VLIB_REGISTER_NODE (tcp6_syn_sent_node)

Definition at line 2632 of file tcp_input.c.

tcp_main_t tcp_main

Definition at line 29 of file tcp.c.

timer_expiration_handler tcp_timer_delack_handler
timer_expiration_handler tcp_timer_persist_handler
timer_expiration_handler tcp_timer_retransmit_handler
timer_expiration_handler tcp_timer_retransmit_syn_handler