public inbox for passt-user@passt.top
 help / color / mirror / Atom feed
From: "Ben Woods" <pasta@ben.woods.am>
To: "Stefano Brivio" <sbrivio@redhat.com>
Cc: passt-user@passt.top
Subject: Re: pasta behaviour with multiple NICs
Date: Fri, 25 Apr 2025 09:03:22	[thread overview]
Message-ID: <524ab7d6-65ce-4843-886e-6b23eaa002ff@app.fastmail.com> (raw)
In-Reply-To: <20250425104956.75d740c8@elisabeth>

Ok - I understand now. Thanks for tolerating my newbie questions - I really appreciate your replies.

On Fri, 25 Apr 2025, at 4:49 PM, Stefano Brivio wrote:
> On Fri, 25 Apr 2025 15:49:16 +0800
> "Ben Woods" <pasta@ben.woods.am> wrote:
>
>> Hi Stefano,
>> 
>> Thanks for the quick response.
>> 
>> I think my questions came from a misunderstanding of how pasta works.
>> I was thinking about the container network namespace directly sending
>> the traffic out the host physical interface based on the IP/gateway
>> inside the netns.
>> 
>> Reading your answer, I think I understand now that in fact the
>> network connection from inside the container netns is connected via a
>> socket to pasta running on the host…
>
> Not even via a socket, it's a tap (tuntap) file descriptor:
>
>   https://passt.top/#pasta-pack-a-subtle-tap-abstraction
>
> with all the traffic encapsulated in Ethernet-like frames (Layer-2).
>
> We also have a "tap bypass" path but that's for loopback traffic only.
>
>> and then pasta simply creates
>> the TCP or UDP socket connection out the host physical interface
>> using the host network stack. Is that correct?
>
> This part is correct, yes.
>
>> That then explains why you’re saying that pasta itself is not
>> choosing the egress interface, route or source IP… it’s the kernel
>> that does that when pasta creates the TCP/UDP connection. Hence the
>> traffic egress interface, source IP and next-hop should be the same
>> as if it originated from a process on the host.
>
> Right.
>
>> It does make we wonder what’s the purpose of assigning an
>> IP/subnet/gateway inside the container netns at all - if all
>> connections are sent via the socket and host pasta process then
>> creates the actual connection?
>
> Because it makes things transparent (again, by default) which is an
> advantage for many applications, for example service meshes, or
> any transport / application protocol that might embed IP addresses in
> the protocol itself (think of SIP for example).
>
> And, albeit with some drawbacks, in general it might also be more
> intuitive for users.
>
> -- 
> Stefano

-- 
From: Ben Woods
ben@woods.am

  reply	other threads:[~2025-04-25  9:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38893f85-ca3d-4e1e-929d-236df89ab9f6@app.fastmail.com>
2025-04-25  7:26 ` pasta behaviour with multiple NICs Stefano Brivio
2025-04-25  7:49   ` Ben Woods
2025-04-25  8:49     ` Stefano Brivio
2025-04-25  7:03       ` Ben Woods [this message]
     [not found]     ` <174557100872.151934.16258096252005211440@maja>
2025-04-28  4:02       ` David Gibson

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=524ab7d6-65ce-4843-886e-6b23eaa002ff@app.fastmail.com \
    --to=pasta@ben.woods.am \
    --cc=passt-user@passt.top \
    --cc=sbrivio@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.
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).