public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* UDP "splicing" fairly broken :(
@ 2022-11-17  5:07 David Gibson
  2022-11-17  7:21 ` Stefano Brivio
  0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2022-11-17  5:07 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: passt-dev

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

In preparation for trying to implement dual stack sockets for UDP,
I've been getting my head around how the UDP splicing works.  Alas,
I'm pretty sure that it's broken if there's not a one-to-one
correspondence between init side source ports and ns side destination
ports.  That will typically be the case, but given its UDP there's no
guarantee.

In addition, UDP servers in the ns will not see the correct port
numbers with getpeername().  That's also true of spliced TCP
connections (see https://bugs.passt.top/show_bug.cgi?id=39), but it's
more likely to matter for UDP (I don't know of any TCP protocols that
care about source port number on the server side, but there are some
common UDP protocols that have at least port number conventions on
both sides).

I can expand on the details later, but pasta will do the wrong thing
in at least some circumstances for both a single init side socket
sendto()ing packets to multiple different ports in the ns/guest and
multiple init side sockets send()ing to the same port in the ns/guest.

I think I know how to fix it, but it's not a trivial job.  So, the
question is do I embark on this now, or do I just remove UDP
"splicing" entirely for the time being (other than a minimum required
to make -U work)?  That would unblock dual stack UDP sockets and we
can attempt to reoptimize this later.

-- 
David Gibson			| 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-18  5:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  5:07 UDP "splicing" fairly broken :( David Gibson
2022-11-17  7:21 ` Stefano Brivio
2022-11-17 10:30   ` David Gibson
2022-11-17 20:02     ` Stefano Brivio
2022-11-18  5:08       ` David Gibson

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