On Fri, Apr 25, 2025 at 10:49:56AM +0200, Stefano Brivio via user wrote: > Date: Fri, 25 Apr 2025 10:49:56 +0200 > From: Stefano Brivio > To: Ben Woods > CC: passt-user@passt.top > Subject: Re: pasta behaviour with multiple NICs > Organization: Red Hat > List-Id: "For passt users: support, questions and answers" > > > On Fri, 25 Apr 2025 15:49:16 +0800 > "Ben Woods" 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). I think reasonable people can disagree on exactly what "transparent" should mean in this context. Mostly we try to make networking inside the container look as much like networking on the host does as possible. Of course, we can't make it 100% alike, so sometimes "as close as possible" is more confusing rather than less. I have ideas for how to rework this in ways that will be both more flexible and (I think) less confusing. However, because there's not a lot of functional difference, it's been a pretty low priority to implement. I hope we can get to it some time, but we don't really have any idea when. > And, albeit with some drawbacks, in general it might also be more > intuitive for users. > > _______________________________________________ > user mailing list -- passt-user@passt.top > To unsubscribe send an email to passt-user-leave@passt.top -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson