# netstat -a | grep .80
otss7901_eri0.80 172.20.56.3.42622 32768 0 33580 0 CLOSE_WAIT
otss7901_eri0.80 172.20.56.2.61909 32768 0 33580 0 CLOSE_WAIT
otss7901_eri0.80 172.20.56.3.42624 32768 0 33580 0 CLOSE_WAIT
- ハーフクローズ。
- 通信相手側から「FIN」を受信し(先に送った方=アクティブクローズ)、相手がCloseしている状態だが自分自身は送信できる状態。
- CLOSE_WAITは tcp_keepalive_interval 秒後に(デフォルトは2時間)、接続が有効かどうかを確認する(keep-aliveプローブを送信)。
- 到達不能な相手に対してのKeepAliveは、tcp_keepalive_intervalで設定した値では検出しない。
- 相手側がFIN_WAIT2で待っている場合は、ACKが返ってきて接続が維持される。
- 相手側が tcp_fin_timeout によってクローズ済みの場合、リセット(RST)が返ってきて、こちら側もクローズになる。
- 断線などで相手まで到達できなかった場合、 tcp_keepalive_intvl (デフォルト75)秒置きに、tcp_keepalive_probes (デフォルト10)回プローブを送信する。
- ネットワーク接続の相手側が接続を維持している(接続が生きている)状態かどうか活性をチェックする。
- 送信側では、接続の切断はデータ送信を試行するとすぐに検出されるため、この活性チェックは、データの受信を待機している接続の終端側にのみ適用されます。
- 活性チェックを行わなければ、サーバは失われた接続に対して、まだ接続が生きていると誤解して非常に多くのリソースを使うことになります。
- ndd ユーティリティを使用して、tcp_keepalive_interval (Ti)をミリ秒単位で設定します。次のように指定すると、値がデフォルトの2 時間に設定されます。
現在の値は次のようにして調査できます。
ndd -get /dev/tcp tcp_keepalive_interval
&color(){}
値 | default値 | 推奨値 | 説明 |
/dev/ip ip_ignore_redirect | 0 | 1 | ICMP リダイレクトを無視するかどうか。 |
/dev/tcp tcp_conn_grace_period | 0 msec | 500 | コネクション確立過程で SYN を送信するとき、タイマーイン間隔に追加される時間。 |
/dev/tcp tcp_conn_req_max_q | 128 | 8096 (*) | 待機中の TCP コネクションの最大値。 |
/dev/tcp tcp_conn_req_max_q0 | 1024 | 8096 (*) | TCP リスナに対して、未完了(3way-handshake が完了していない)のコネクション待ち最大数。 |
/dev/tcp tcp_conn_req_min | 1 | 1 | 最大待機コネクション数の最小値。 |
/dev/tcp tcp_cwnd_max | 1048576 | 65534 | 輻輳ウィンドウ(cwnd,Congestion Window)の最大値。 |
/dev/tcp tcp_fin_wait_2_flush_interval | 675000 msec | 16000 | アプリケーション終了後、エンドポイントがどのくらいで FIN_WAIT_2 状態にとどまるかを設定する値。 |
/dev/tcp tcp_ip_abort_cinterval | 180000 msec | 60000 | コネクション時(確立後)の(トータル再転送)タイムアウト時間。 |
/dev/tcp tcp_ip_abort_interval | 8 min(480000 msec) | 60000 | トータルの再送タイムアウト(RTO)の値(msec)。この値の間再送し続け、一方のエンドポイントから ACK が帰ってこない場合はコネクションをクローズ。 |
/dev/tcp tcp_keepalive_interval | 7200000 ms (2 hours) | 90000 | デフォルトの keepalive タイマ値。 |
/dev/tcp tcp_rexmit_interval_initial | 3 sec | 3000 | 再送タイムアウト(RTO)の初期値(msec)。 |
/dev/tcp tcp_rexmit_interval_max | 3 sec | 10000 | 再送タイムアウト(RTO)の最大値(msec)。 |
/dev/tcp tcp_rexmit_interval_min | 400 msec | 3000 | 再送タイムアウト(RTO)の最小値(msec)。 |
/dev/tcp tcp_slow_start_initial | 4 | 2 | TCP コネクションにおける MSS での最大輻輳ウィンドウサイズの初期値。 |
/dev/tcp tcp_time_wait_interval | 4 min | 60000 (**) | TCP コネクションが TIME_WAIT 状態にとどまる時間。 |
/dev/tcp tcp_xmit_hiwat | 16384 | 32768 | バイト単位のデフォルトの送信ウィンドウサイズ。 |
/dev/tcp tcp_recv_hiwat | 24576 | 32768 | バイト単位のデフォルトの受信ウィンドウサイズ。 |
http://homepage2.nifty.com/BASH/sol/ndd.html
# /usr/sbin/ndd /dev/tcp \?
? (read only)
tcp_time_wait_interval (read and write)
tcp_conn_req_max_q (read and write)
tcp_conn_req_max_q0 (read and write)
tcp_conn_req_min (read and write)
tcp_conn_grace_period (read and write)
tcp_cwnd_max (read and write)
tcp_debug (read and write)
tcp_smallest_nonpriv_port (read and write)
tcp_ip_abort_cinterval (read and write)
tcp_ip_abort_linterval (read and write)
tcp_ip_abort_interval (read and write)
tcp_ip_notify_cinterval (read and write)
tcp_ip_notify_interval (read and write)
tcp_ipv4_ttl (read and write)
tcp_keepalive_interval (read and write)
tcp_maxpsz_multiplier (read and write)
tcp_mss_def_ipv4 (read and write)
tcp_mss_max_ipv4 (read and write)
tcp_mss_min (read and write)
tcp_naglim_def (read and write)
tcp_rexmit_interval_initial (read and write)
tcp_rexmit_interval_max (read and write)
tcp_rexmit_interval_min (read and write)
tcp_deferred_ack_interval (read and write)
tcp_snd_lowat_fraction (read and write)
tcp_sth_rcv_hiwat (read and write)
tcp_sth_rcv_lowat (read and write)
tcp_dupack_fast_retransmit (read and write)
tcp_ignore_path_mtu (read and write)
tcp_rcv_push_wait (read and write)
tcp_smallest_anon_port (read and write)
tcp_largest_anon_port (read and write)
tcp_xmit_hiwat (read and write)
tcp_xmit_lowat (read and write)
tcp_recv_hiwat (read and write)
tcp_recv_hiwat_minmss (read and write)
tcp_fin_wait_2_flush_interval (read and write)
tcp_co_min (read and write)
tcp_max_buf (read and write)
tcp_strong_iss (read and write)
tcp_rtt_updates (read and write)
tcp_wscale_always (read and write)
tcp_tstamp_always (read and write)
tcp_tstamp_if_wscale (read and write)
tcp_rexmit_interval_extra (read and write)
tcp_deferred_acks_max (read and write)
tcp_slow_start_after_idle (read and write)
tcp_slow_start_initial (read and write)
tcp_co_timer_interval (read and write)
tcp_sack_permitted (read and write)
tcp_trace (read and write)
tcp_compression_enabled (read and write)
tcp_ipv6_hoplimit (read and write)
tcp_mss_def_ipv6 (read and write)
tcp_mss_max_ipv6 (read and write)
tcp_rev_src_routes (read and write)
tcp_ndd_get_info_interval (read and write)
tcp_rst_sent_rate_enabled (read and write)
tcp_rst_sent_rate (read and write)
tcp_use_smss_as_mss_opt (read and write)
tcp_wroff_xtra (read and write)
tcp_extra_priv_ports (read only)
tcp_extra_priv_ports_add (write only)
tcp_extra_priv_ports_del (write only)
tcp_status (read only)
tcp_bind_hash (read only)
tcp_listen_hash (read only)
tcp_conn_hash (read only)
tcp_acceptor_hash (read only)
tcp_host_param (read and write)
tcp_time_wait_stats (read only)
tcp_host_param_ipv6 (read and write)
tcp_1948_phrase (write only)
tcp_reserved_port_list (read only)
tcp_close_wait_interval(obsoleted- use tcp_time_wait_interval) (no read or write)
? (read only)
tcp_time_wait_interval (read and write)
tcp_conn_req_max_q (read and write)
tcp_conn_req_max_q0 (read and write)
tcp_conn_req_min (read and write)
tcp_conn_grace_period (read and write)
tcp_cwnd_max (read and write)
tcp_debug (read and write)
tcp_smallest_nonpriv_port (read and write)
tcp_ip_abort_cinterval (read and write)
tcp_ip_abort_linterval (read and write)
tcp_ip_abort_interval (read and write)
tcp_ip_notify_cinterval (read and write)
tcp_ip_notify_interval (read and write)
tcp_ipv4_ttl (read and write)
tcp_keepalive_interval (read and write)
tcp_maxpsz_multiplier (read and write)
tcp_mss_def_ipv4 (read and write)
tcp_mss_max_ipv4 (read and write)
tcp_mss_min (read and write)
tcp_naglim_def (read and write)
tcp_rexmit_interval_initial (read and write)
tcp_rexmit_interval_max (read and write)
tcp_rexmit_interval_min (read and write)
tcp_deferred_ack_interval (read and write)
tcp_snd_lowat_fraction (read and write)
tcp_sth_rcv_hiwat (read and write)
tcp_sth_rcv_lowat (read and write)
tcp_dupack_fast_retransmit (read and write)
tcp_ignore_path_mtu (read and write)
tcp_rcv_push_wait (read and write)
tcp_smallest_anon_port (read and write)
tcp_largest_anon_port (read and write)
tcp_xmit_hiwat (read and write)
tcp_xmit_lowat (read and write)
tcp_recv_hiwat (read and write)
tcp_recv_hiwat_minmss (read and write)
tcp_fin_wait_2_flush_interval (read and write)
tcp_co_min (read and write)
tcp_max_buf (read and write)
tcp_strong_iss (read and write)
tcp_rtt_updates (read and write)
tcp_wscale_always (read and write)
tcp_tstamp_always (read and write)
tcp_tstamp_if_wscale (read and write)
tcp_rexmit_interval_extra (read and write)
tcp_deferred_acks_max (read and write)
tcp_slow_start_after_idle (read and write)
tcp_slow_start_initial (read and write)
tcp_co_timer_interval (read and write)
tcp_sack_permitted (read and write)
tcp_trace (read and write)
tcp_compression_enabled (read and write)
tcp_ipv6_hoplimit (read and write)
tcp_mss_def_ipv6 (read and write)
tcp_mss_max_ipv6 (read and write)
tcp_rev_src_routes (read and write)
tcp_ndd_get_info_interval (read and write)
tcp_rst_sent_rate_enabled (read and write)
tcp_rst_sent_rate (read and write)
tcp_use_smss_as_mss_opt (read and write)
tcp_wroff_xtra (read and write)
tcp_extra_priv_ports (read only)
tcp_extra_priv_ports_add (write only)
tcp_extra_priv_ports_del (write only)
tcp_status (read only)
tcp_bind_hash (read only)
tcp_listen_hash (read only)
tcp_conn_hash (read only)
tcp_acceptor_hash (read only)
tcp_host_param (read and write)
tcp_time_wait_stats (read only)
tcp_host_param_ipv6 (read and write)
tcp_1948_phrase (write only)
tcp_reserved_port_list (read only)
tcp_close_wait_interval(obsoleted- use tcp_time_wait_interval) (no read or write)
# netstat -s -P tcp
TCP
tcpRtoAlgorithm = 4 tcpRtoMin = 400
tcpRtoMax = 60000 tcpMaxConn = -1
tcpActiveOpens =184884 tcpPassiveOpens =180292
tcpAttemptFails = 1666 tcpEstabResets = 904
tcpCurrEstab = 35 tcpOutSegs =12123178
tcpOutDataSegs =9885623 tcpOutDataBytes =3260466403
tcpRetransSegs = 9253 tcpRetransBytes =2046536
tcpOutAck =2237525 tcpOutAckDelayed =1270574
tcpOutUrg = 0 tcpOutWinUpdate = 1466
tcpOutWinProbe = 1 tcpOutControl =729858
tcpOutRsts = 760 tcpOutFastRetrans = 392
tcpInSegs =12456465
tcpInAckSegs =9497451 tcpInAckBytes =3260671114
tcpInDupAck =543250 tcpInAckUnsent = 0
tcpInInorderSegs =8856466 tcpInInorderBytes =2342992835
tcpInUnorderSegs = 393 tcpInUnorderBytes =555777
tcpInDupSegs = 116 tcpInDupBytes = 10596
tcpInPartDupSegs = 3 tcpInPartDupBytes = 1975
tcpInPastWinSegs = 4 tcpInPastWinBytes = 12008
tcpInWinProbe = 2 tcpInWinUpdate = 1
tcpInClosed = 26 tcpRttNoUpdate = 4097
tcpRttUpdate =9134664 tcpTimRetrans = 6947
tcpTimRetransDrop = 205 tcpTimKeepalive = 10348
tcpTimKeepaliveProbe= 1904 tcpTimKeepaliveDrop = 13
tcpListenDrop = 0 tcpListenDropQ0 = 0
tcpHalfOpenDrop = 0 tcpOutSackRetrans = 982
TCP
tcpRtoAlgorithm = 4 tcpRtoMin = 400
tcpRtoMax = 60000 tcpMaxConn = -1
tcpActiveOpens =184884 tcpPassiveOpens =180292
tcpAttemptFails = 1666 tcpEstabResets = 904
tcpCurrEstab = 35 tcpOutSegs =12123178
tcpOutDataSegs =9885623 tcpOutDataBytes =3260466403
tcpRetransSegs = 9253 tcpRetransBytes =2046536
tcpOutAck =2237525 tcpOutAckDelayed =1270574
tcpOutUrg = 0 tcpOutWinUpdate = 1466
tcpOutWinProbe = 1 tcpOutControl =729858
tcpOutRsts = 760 tcpOutFastRetrans = 392
tcpInSegs =12456465
tcpInAckSegs =9497451 tcpInAckBytes =3260671114
tcpInDupAck =543250 tcpInAckUnsent = 0
tcpInInorderSegs =8856466 tcpInInorderBytes =2342992835
tcpInUnorderSegs = 393 tcpInUnorderBytes =555777
tcpInDupSegs = 116 tcpInDupBytes = 10596
tcpInPartDupSegs = 3 tcpInPartDupBytes = 1975
tcpInPastWinSegs = 4 tcpInPastWinBytes = 12008
tcpInWinProbe = 2 tcpInWinUpdate = 1
tcpInClosed = 26 tcpRttNoUpdate = 4097
tcpRttUpdate =9134664 tcpTimRetrans = 6947
tcpTimRetransDrop = 205 tcpTimKeepalive = 10348
tcpTimKeepaliveProbe= 1904 tcpTimKeepaliveDrop = 13
tcpListenDrop = 0 tcpListenDropQ0 = 0
tcpHalfOpenDrop = 0 tcpOutSackRetrans = 982
タグ
このページへのコメント
sVBRup Thank you ever so for you post.Thanks Again. Keep writing.
n2eX75 I really like and appreciate your blog article.Thanks Again. Much obliged.
YxAtu9 Thanks a lot for the post.Much thanks again. Want more.
yRxqPQ <a href="http://ctrjtgraerxg.com/">ctrjtgraerxg</a>, [url=http://klcfaeddyhum.com/]klcfaeddyhum[/url], [link=http://zqafotzfbogs.com/]zqafotzfbogs[/link], http://jtnxocjzzkil.com/
68nhuf <a href="http://ofwxhrmyqnhz.com/">ofwxhrmyqnhz</a>, [url=http://cifudbicgewn.com/]cifudbicgewn[/url], [link=http://hijmxtngswix.com/]hijmxtngswix[/link], http://hfkjazuythus.com/