mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: patrick mcmanus <mcmanus@ducksong.com>
To: rol@as2917.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: TCP retransmission : how to detect from an application ?
Date: Wed, 02 Jun 2004 16:25:12 -0400	[thread overview]
Message-ID: <1086207911.11413.18.camel@mcmanus.datapower.com> (raw)
In-Reply-To: <200406021257.i52CvEX31840@tag.witbe.net>

On Wed, 2004-06-02 at 08:57, Paul Rolland wrote:
> corrected by the kernel (hell, TCP is reliable, isn't it :-), but I'd like
> to know if an application can detect this (well, I don't want to be notified
> of a packet loss once detected, but I'd like to get some stats before
> closing
> the connection).

#include <linux/tcp.h>

struct tcp_info info;

getsockopt (... TCP_INFO ... &info ...);

and you get all of this (you'll have to see net/ipv4/tcp.c to see how it
all gets filled in.. I'm not aware of better documentation than that):

struct tcp_info
{
    __u8    tcpi_state;
    __u8    tcpi_ca_state;
    __u8    tcpi_retransmits;
    __u8    tcpi_probes;
    __u8    tcpi_backoff;
    __u8    tcpi_options;
    __u8    tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;

    __u32   tcpi_rto;
    __u32   tcpi_ato;
    __u32   tcpi_snd_mss;
    __u32   tcpi_rcv_mss;

    __u32   tcpi_unacked;
    __u32   tcpi_sacked;
    __u32   tcpi_lost;
    __u32   tcpi_retrans;
    __u32   tcpi_fackets;

    /* Times. */
    __u32   tcpi_last_data_sent;
    __u32   tcpi_last_ack_sent;     /* Not remembered, sorry. */
    __u32   tcpi_last_data_recv;
    __u32   tcpi_last_ack_recv;

    /* Metrics. */
    __u32   tcpi_pmtu;
    __u32   tcpi_rcv_ssthresh;
    __u32   tcpi_rtt;
    __u32   tcpi_rttvar;
    __u32   tcpi_snd_ssthresh;
    __u32   tcpi_snd_cwnd;
    __u32   tcpi_advmss;
    __u32   tcpi_reordering;
};



  reply	other threads:[~2004-06-02 20:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 12:57 Paul Rolland
2004-06-02 20:25 ` patrick mcmanus [this message]
     [not found] <22DFj-7Zd-1@gated-at.bofh.it>
2004-06-02 13:33 ` Andi Kleen
2004-06-02 14:58   ` Paul Rolland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1086207911.11413.18.camel@mcmanus.datapower.com \
    --to=mcmanus@ducksong.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rol@as2917.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®