public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Yumei Huang <yuhuang@redhat.com>,
	passt-dev@passt.top, lvivier@redhat.com
Subject: Re: [PATCH] tap: Drop frames if no client connected
Date: Wed, 24 Sep 2025 11:56:33 +0200	[thread overview]
Message-ID: <20250924115633.01368e9a@elisabeth> (raw)
In-Reply-To: <aNNOKGXdWNMVW8XO@zatzit>

On Wed, 24 Sep 2025 11:49:28 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> So... summarising.  As I see it, we have two main cases to consider:
> the one where the guest comes online pretty soon, and the one where it
> doesn't.  Here's what I think the behaviour would be for these two
> cases with a variety of ways of handling it.  This is more-or-less
> from the peer's perspective.
> 
> (0) Physicaly disconnected guest (bridged network, no passt involved)
> 
>     (0a) Guest online never
>         SYN ... SYN ... SYN ... <peer times out>
> 
>     (0b) Guest online soonish
>         SYN ... SYN ... SYN-ACK, ACK <working connection>
> 
> (1) Status quo
> 
> Passt doesn't resend SYNs, and will time out the connection after 10s.
> 
>     (1a) Guest online never
>         SYN, SYN-ACK, ACK ... ... ... ... <passt times out> RST
> 
>     (0b) Guest online soonish
>         SYN, SYN-ACK, ACK ... ... ... ... <passt times out> RST
> 
> (2) Yumei's patch
> 
> As (1), but without EBADFs
> 
> (3) passt resends SYNs
> 
>     (3a) Guest online never
>         SYN, SYN-ACK, ACK ... ... ... ... ... <passt times out> RST
> 
>     (3b) Guest online soonish
>         SYN, SYN-ACK, ACK ... ... ... ... <working connection>
> 
> (4) Passt resends SYNs + Yumei's patch
> 
> As (3), but without EBADFs
> 
> (5) passt explicitly resets when guest is not present
> 
>     (6a) Guest online never
>         SYN, SYN-ACK, ACK, RST
> 
>     (6b) Guest online soonish
>         SYN, SYN-ACK, ACK, RST
> 
> (6) Delayed listen()
> 
>     (6a) Guest online never
>         SYN, RST
> 
>     (6b) Guest online soonish
>         SYN, RST
> 
> (99) Bridged guest isn't listening (no passt)
> 
>     (99a) Guest online never
>         SYN, RST
> 
>     (99b) Guest online soonish
>         SYN, RST
> 
> =====

It all makes sense, thanks for summarising those.

> So, if (99) is our model, we can match it pretty exactly with delayed
> listen().  But if (0) is our model, the closest we can get is (3) or
> (4), which I think will look fairly similar to peer application, even
> though it looks different to the peer TCP stack.
> 
> I think (0) is a better model, because it means we won't reset
> connections if they happen to land when a still running guest has its
> connection to passt temporarily interrupted.
> 
> Which brings me, I think, to the same conclusion you had: we should
> resend SYNs.
> 
> Suggested next steps:
>  - Apply Yumei's patch, it doesn't change behaviour and removes the
>    odd EBADFs
>  - Yumei investigates implementing SYN resends

Right, that also makes sense to me.

For the second part, we could probably reuse a mechanism similar to
what we do for re-transmits, and perhaps rename 'retrans' in struct
tcp_tap_conn to 'retries', so that we can use it for both (we're a bit
tight on space there).

-- 
Stefano


  reply	other threads:[~2025-09-24  9:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11  8:55 Yumei Huang
2025-09-11  9:54 ` Stefano Brivio
2025-09-12  2:01   ` David Gibson
2025-09-12  2:45     ` Yumei Huang
2025-09-15  6:13       ` Stefano Brivio
2025-09-15  6:13     ` Stefano Brivio
2025-09-18  4:28       ` David Gibson
2025-09-18  7:17         ` Stefano Brivio
2025-09-19  1:33           ` David Gibson
2025-09-22  7:17             ` Yumei Huang
2025-09-22 20:03               ` Stefano Brivio
2025-09-23  7:53                 ` David Gibson
2025-09-23 11:00                   ` Stefano Brivio
2025-09-23 11:26                     ` David Gibson
2025-09-23 23:56                       ` Stefano Brivio
2025-09-24  1:49                         ` David Gibson
2025-09-24  9:56                           ` Stefano Brivio [this message]
2025-09-25  5:08                             ` Yumei Huang
2025-09-25  6:05                               ` Stefano Brivio

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=20250924115633.01368e9a@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=yuhuang@redhat.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).