AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 542712
Accepted
sebelk
sebelk
Asked: 2019-09-20 13:13:38 +0800 CST2019-09-20 13:13:38 +0800 CST 2019-09-20 13:13:38 +0800 CST

ss 命令的详细输出

  • 772

我想知道 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:我不知道是彩信接收
  • 建议:?
  • 应用程序限制:?
  • 忙碌的: ?
  • 重新翻译:?
  • dsack_dups:重复的段?
  • minrtt:在套接字中达到的最小 RTT?
tcp
  • 2 2 个回答
  • 4724 Views

2 个回答

  • Voted
  1. Best Answer
    Arkadiusz Drabczyk
    2019-09-20T15:30:11+08:002019-09-20T15:30:11+08:00

    其中一些字段的含义可以从 ss和 Linux 内核的源代码中推断出来。您看到的信息是按中的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.hLinux中没有记录那个:

    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.capp_limitedtcpi_delivery_rate_app_limited

    忙:

    在ss.c:

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

    在include/uapi/linux/tcp.hLinux中它说:

    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.hLinux 中:

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

    在https://www.ietf.org/rfc/rfc4898.txt:

    D-SACK 块向本地主​​机报告的重复段数。

    • 8
  2. saleetzo
    2019-09-20T14:00:51+08:002019-09-20T14:00:51+08:00

    MSS 通常代表最大段大小。

    rcvmss:您让同行知道您将接受的最大分段大小

    advmss: 通告最大段大小

    app_limited: 在请求或响应中使用应用程序限制来限制 TCP 流

    busy: TCP 连接忙??

    retrans: 重传定时器。如果一个数据包的发送者在定时器超时之前没有收到ack,它会尝试重传这个包

    dsack_dups: 重复选择性确认

    minrtt:最小往返时间,数据包从源到目的地的最短时间

    让我知道其中是否有任何错误,我会更正。

    • 1

相关问题

  • 创建套接字文件是否需要 AF_INET?

  • UDP 或 TCP 打孔以连接两个对等点(每个对等点位于路由器后面)

  • 通过 TCP 构建 Unix 套接字桥

  • 连接到 IP 0.0.0.0 成功。如何?为什么?

  • Linux中哪个进程负责TCP

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve