ss 명령의 자세한 출력

ss 명령의 자세한 출력

ss 명령 출력에서 ​​특정 항목의 의미를 알고 싶습니다. 예를 들어:

# sudo   ss -iepn '( dport = :3443 )'

Netid      State      Recv-Q      Send-Q             Local Address:Port              Peer Address:Port      
tcp        ESTAB      0           0                  192.168.43.39:45486              190.0.2.1:443       users:(("rocketchat-desk",pid=28697,fd=80)) timer:(keepalive,11sec,0) uid:1000 ino:210510085 sk:16f1 <->
         ts sack cubic wscale:7,7 rto:573 rtt:126.827/104.434 ato:40 mss:1388 pmtu:1500 rcvmss:1388 advmss:1448 cwnd:10 bytes_sent:12904 bytes_retrans:385 bytes_acked:12520 bytes_received:13322 segs_out:433 segs_in:444 data_segs_out:215 data_segs_in:253 send 875.5Kbps lastsnd:18722 lastrcv:18723 lastack:18662 pacing_rate 1.8Mbps delivery_rate 298.1Kbps delivered:216 busy:16182ms retrans:0/10 dsack_dups:10 rcv_rtt:305 rcv_space:14480 rcv_ssthresh:6
CLOSE-WAIT      1           0                [2800:810:54a:7f0::1000]:37844                                     [2800:3f0:4002:803::200a]:443                    users:(("plasma-browser-",pid=16020,fd=175)) uid:1000 ino:90761 sk:1d -->
         ts sack cubic wscale:8,7 rto:222 rtt:21.504/5.045 ato:40 mss:1348 pmtu:1500 rcvmss:1208 advmss:1428 cwnd:10 bytes_sent:1470 bytes_acked:1471 bytes_received:11214 segs_out:20 segs_in:20 data_segs_out:8 data_segs_in:13 send 5014881bps lastsnd:96094169 lastrcv:96137280 lastack:96094142 pacing_rate 10029464bps delivery_rate 1363968bps delivered:9 app_limited busy:91ms rcv_space:14280 rcv_ssthresh:64108 minrtt:17.458

주로 ss 매뉴얼 페이지에서 누락된 항목입니다. 저는 몇 가지 추측을 했습니다. 제가 틀렸다면 정정해 주십시오:

  • rcvmss: MMS 수신에 대해 알고 싶어요
  • 광고주:?
  • 신청 제한:?
  • 바쁘다: ?
  • 재전송:?
  • dsack_dups: 세그먼트가 중복되었나요?
  • minrtt: 소켓에서 최소 RTT에 도달했습니까?

답변1

이러한 필드 중 일부의 의미는 소스 코드에서 추론할 수 있습니다. 봄 여름 시즌그리고 리눅스 커널. 표시되는 정보는 의 tcp_show_info() 함수에 의해 인쇄 됩니다 iproute2/misc/ss.c.

광고 관리 시스템:

존재하다 ss.c:

s.advmss     = info->tcpi_advmss;
(...)
    if (s->advmss)
        out(" advmss:%d", s->advmss);

존재하다 linux/include/linux/tcp.h:

u16 advmss;     /* Advertised MSS           */

신청 제한사항:

존재하다 ss.c:

s.app_limited = info->tcpi_delivery_rate_app_limited;
(..)
if (s->app_limited)
   out(" app_limited");

linux/include/uapi/linux/tcp.h이는 Linux에 문서화되어 있지 않습니다.

struct tcp_info {
(...)
    __u8    tcpi_delivery_rate_app_limited:1;

그러나 놀랍게도 이를 소개한 커밋에서 몇 가지 정보를 찾을 수 있습니다.

commit eb8329e0a04db0061f714f033b4454326ba147f4
Author: Yuchung Cheng <[email protected]>
Date:   Mon Sep 19 23:39:16 2016 -0400

    tcp: export data delivery rate

    This commit export two new fields in struct tcp_info:

      tcpi_delivery_rate: The most recent goodput, as measured by
        tcp_rate_gen(). If the socket is limited by the sending
        application (e.g., no data to send), it reports the highest
        measurement instead of the most recent. The unit is bytes per
        second (like other rate fields in tcp_info).

      tcpi_delivery_rate_app_limited: A boolean indicating if the goodput
        was measured when the socket's throughput was limited by the
        sending application.

    This delivery rate information can be useful for applications that
    want to know the current throughput the TCP connection is seeing,
    e.g. adaptive bitrate video streaming. It can also be very useful for
    debugging or troubleshooting.

빠른 git blame확인은 ss.c커널에 추가된 app_limited후 추가 되었습니다.tcpi_delivery_rate_app_limited

바쁘다:

존재하다 ss.c:

s.busy_time = info->tcpi_busy_time;
(..)
    if (s->busy_time) {
        out(" busy:%llums", s->busy_time / 1000);

Linux 에서는 include/uapi/linux/tcp.h다음과 같이 말합니다.

struct tcp_info {
(...)
    __u64   tcpi_busy_time;      /* Time (usec) busy sending data */

재전송:

존재하다 ss.c:

s.retrans    = info->tcpi_retrans;
s.retrans_total  = info->tcpi_total_retrans;
(...)
    if (s->retrans || s->retrans_total)
        out(" retrans:%u/%u", s->retrans, s->retrans_total);

tcpi_total_retrans다음에 설명되지 않음 linux/include/uapi/linux/tcp.h:

struct tcp_info {
(...)
    __u32   tcpi_total_retrans;

하지만 다음 용도로 사용됩니다 tcp_get_info().

void tcp_get_info(struct sock *sk, struct tcp_info *info)
{
    const struct tcp_sock *tp = tcp_sk(sk); /* iff sk_type == SOCK_STREAM */
(...)
    info->tcpi_total_retrans = tp->total_retrans;

내용 linux/include/linux/tcp.h은 다음과 같습니다:

struct tcp_sock {
(...)
    u32 total_retrans;  /* Total retransmits for entire connection */

tcpi_retrans설명도 없지만 tcp_get_info() 다시 읽어보면 다음과 같습니다.

info->tcpi_retrans = tp->retrans_out;

그리고 linux/include/linux/tcp.h:

struct tcp_sock {
(...)
    u32 retrans_out;    /* Retransmitted packets out        */

dsack_dups:

존재하다 ss.c:

s.dsack_dups = info->tcpi_dsack_dups;
(...)
    if (s->dsack_dups)
        out(" dsack_dups:%u", s->dsack_dups);

include/uapi/linux/tcp.h리눅스 에서 :

struct tcp_info {
(...)
__u32   tcpi_dsack_dups;     /* RFC4898 tcpEStatsStackDSACKDups */

그리고https://www.ietf.org/rfc/rfc4898.txt:

D-SACK 블록 로컬 호스트에 보고된 중복 세그먼트 수입니다.

답변2

MSS는 일반적으로 최대 세그먼트 크기를 나타냅니다.

rcvmss: 동료에게 허용할 수 있는 최대 세그먼트 크기를 알립니다.

advmss:최대 세그먼트 크기를 광고합니다.

app_limited: 요청 또는 응답의 애플리케이션 제한을 통해 TCP 트래픽을 제한합니다.

busy: TCP 연결이 사용 중입니까? ?

retrans: 재전송 타이머. 타이머가 만료되기 전에 패킷 보낸 사람이 ack를 받지 못하면 패킷 재전송을 시도합니다.

dsack_dups: 선택적 확인 반복

minrtt: 최소 왕복 시간, 데이터 패킷이 소스에서 목적지까지 이동하는 가장 짧은 시간

내용에 오류가 있으면 알려주시면 수정하겠습니다.

관련 정보