Re: [Masque] QUIC non-encapsulation and CIDs

Tommy Pauly <tpauly@apple.com> Wed, 09 November 2022 20:49 UTC

Return-Path: <tpauly@apple.com>
X-Original-To: masque@ietfa.amsl.com
Delivered-To: masque@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B56F1C14CE47 for <masque@ietfa.amsl.com>; Wed, 9 Nov 2022 12:49:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.677
X-Spam-Level:
X-Spam-Status: No, score=-2.677 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=apple.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5dh0S1jqVjXh for <masque@ietfa.amsl.com>; Wed, 9 Nov 2022 12:49:47 -0800 (PST)
Received: from rn-mailsvcp-ppex-lapp34.apple.com (rn-mailsvcp-ppex-lapp34.rno.apple.com [17.179.253.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D5470C14CF03 for <masque@ietf.org>; Wed, 9 Nov 2022 12:49:47 -0800 (PST)
Received: from pps.filterd (rn-mailsvcp-ppex-lapp34.rno.apple.com [127.0.0.1]) by rn-mailsvcp-ppex-lapp34.rno.apple.com (8.16.1.2/8.16.1.2) with SMTP id 2A9KkIH6020194; Wed, 9 Nov 2022 12:49:46 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=K28wlU34xN2oaNFTq40ojDemG5q8pLZbNgE3RmESNiY=; b=XV2xPlVQr4C4cXnK6LJfpwsZP10qwxbD1R9EpY/jPYFPF4UEdMV//cv+OgZ330LMFm+S lN6QksK3SgWlvpOevYJUVhiCFyTAP6yn+V2dmrr/0PXgZ+ypMRQK00NsMTZHCkRCAWC5 9PHBJDvRZzZKZFEvC1Cq6N/Rc6UIRWnCSYI28RH6oJdZL+aTKlApfAJWvr257VRP6qrW bbfEmqOflXLhJQekSPAezs1VYDTwfe/4PrigT/Mfe6E0QmG09dM+oY87HGRUiR1i2Sbv HB6VUFtPRIXwm38cbgUjLDejTEoSA9/eoU+OG7owTPHGbZ5MDZH+S/+gQxr81CLJ2blW PA==
Received: from rn-mailsvcp-mta-lapp03.rno.apple.com (rn-mailsvcp-mta-lapp03.rno.apple.com [10.225.203.151]) by rn-mailsvcp-ppex-lapp34.rno.apple.com with ESMTP id 3krjsx825j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 09 Nov 2022 12:49:46 -0800
Received: from rn-mailsvcp-policy-lapp01.rno.apple.com (rn-mailsvcp-policy-lapp01.rno.apple.com [17.179.253.18]) by rn-mailsvcp-mta-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.20.20220923 64bit (built Sep 23 2022)) with ESMTPS id <0RL300LY0LUY6K30@rn-mailsvcp-mta-lapp03.rno.apple.com>; Wed, 09 Nov 2022 12:49:46 -0800 (PST)
Received: from process_milters-daemon.rn-mailsvcp-policy-lapp01.rno.apple.com by rn-mailsvcp-policy-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.20.20220923 64bit (built Sep 23 2022)) id <0RL300100LUOHC00@rn-mailsvcp-policy-lapp01.rno.apple.com>; Wed, 09 Nov 2022 12:49:46 -0800 (PST)
X-Va-A:
X-Va-T-CD: 01a37c4388be431533d60b3d58eeb299
X-Va-E-CD: aad0465d6483c60260ff8d99c239fcb8
X-Va-R-CD: 9508b404f283f72fddb3b4921b7b876b
X-Va-CD: 0
X-Va-ID: 19505cf9-123f-48f0-8cae-44d0dda70930
X-V-A:
X-V-T-CD: 01a37c4388be431533d60b3d58eeb299
X-V-E-CD: aad0465d6483c60260ff8d99c239fcb8
X-V-R-CD: 9508b404f283f72fddb3b4921b7b876b
X-V-CD: 0
X-V-ID: 7e8658f1-210d-43e7-be62-d5db5c2d51db
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.545, 18.0.895 definitions=2022-11-09_06:2022-11-09, 2022-11-09 signatures=0
Received: from smtpclient.apple ([17.11.143.135]) by rn-mailsvcp-policy-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.20.20220923 64bit (built Sep 23 2022)) with ESMTPSA id <0RL3007DALUYNA00@rn-mailsvcp-policy-lapp01.rno.apple.com>; Wed, 09 Nov 2022 12:49:46 -0800 (PST)
From: Tommy Pauly <tpauly@apple.com>
Message-id: <711A02AD-9329-4174-9B15-61B3D9475125@apple.com>
Content-type: multipart/alternative; boundary="Apple-Mail=_2ABD1250-ADB7-46DD-BFAF-C68F3BB2B12E"
MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.300.63.1.1\))
Date: Wed, 09 Nov 2022 12:49:35 -0800
In-reply-to: <976e7806-0e83-4090-95c5-7905f89fe02f@app.fastmail.com>
Cc: masque@ietf.org
To: Martin Thomson <mt@lowentropy.net>
References: <976e7806-0e83-4090-95c5-7905f89fe02f@app.fastmail.com>
X-Mailer: Apple Mail (2.3731.300.63.1.1)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.545, 18.0.895 definitions=2022-11-09_06:2022-11-09, 2022-11-09 signatures=0
Archived-At: <https://mailarchive.ietf.org/arch/msg/masque/CjW2lfFBWZtRa_zRCJdK0chm_CM>
Subject: Re: [Masque] QUIC non-encapsulation and CIDs
X-BeenThere: masque@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Multiplexed Application Substrate over QUIC Encryption <masque.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/masque>, <mailto:masque-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/masque/>
List-Post: <mailto:masque@ietf.org>
List-Help: <mailto:masque-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/masque>, <mailto:masque-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 09 Nov 2022 20:49:51 -0000

Hi Martin,

Thanks for the read-through! Comments inline

> On Nov 9, 2022, at 11:48 AM, Martin Thomson <mt@lowentropy.net> wrote:
> 
> I've been looking more closely at draft-pauly-masque-quic-proxy.  I think that we can fix the protocol so that the use of this mechanism isn't a strict privacy reduction for the general case.  But I want to start with the connection ID design, which I find very confusing in its current form.

Apologies for the confusion. Likely moving diagrams and examples earlier on would help.

> 
> I wasn't able to tell exactly how the connection ID mappings work in the draft.  The structure of the document is a little confusing.  I really hoped that it would discuss how things work rather than just document state and capsule formats.
> 
> The idea something like this:
> 
> 1. Client -> Server direction
> 
> The client tells the proxy about each connection ID used by the server.  The proxy tells the client which connection ID to use for that connection ID when sending packets to the proxy.
> 
> For this the client needs to tell the proxy:
> a) the connection ID the server has provided
> b) (maybe) the stateless reset token that the server will recognize if we want the proxy to be able to terminate the flow
> 
> I want to put a pin in the stateless reset design here, because there are a lot of requirements we might need to discuss regarding that.  More in a follow-up, I think.  Stateless resets that aren't visible to the proxy are not great, but we might want to avoid having the proxy be able to terminate the flow at the client.  There is a simple design for this too - maybe - but I need to think about that some more.
> 
> The proxy can then tell the client
> a) the (virtual) connection ID that the proxy will map to the provided server connection ID
> 
> Here, the client is responsible for forwarding connection IDs from the server to the proxy so that it can be assigned a virtual connection ID.

I believe the document is doing exactly what you’re describing here for this direction.

Taking the example in the document, the client tells the proxy that the CID that the server has provided. (It also includes an optional stateless reset token for the target server, but I realize now that the example didn’t get updated for that.)

The proxy then tells the client a virtual CID that the proxy will map to the target server CID. It also here can include an optional stateless reset token that it will send in response to the client using the virtual CID.

https://tfpauly.github.io/quic-proxy/draft-pauly-masque-quic-proxy.html#name-example

STREAM(44): DATA                -------->
  Capsule Type = REGISTER_TARGET_CID
  Connection ID = 0x61626364
  Stateless Reset Token = Token

           <--------  STREAM(44): DATA
                        Capsule Type = ACK_TARGET_CID
                        Connection ID = 0x61626364
                        Virtual Target Connection ID = 0x123412341234
                        Stateless Reset Token = Token


> 
> Note that I think that virtual connection ID is not a great name, this is a mapped connection ID or a replacement connection ID.  Maybe an overlaid connection ID.

Sure, that’s a fine bike shed. I like “mapped”.
> 
> 
> 2. Server -> Client direction
> 
> The client will need to provide the server with connection IDs that the proxy will accept, so...
> 
> The client tells the proxy:
> a) the connection ID it wants to use
> 
> The proxy responds with:
> a) the connection ID that it wants the client to pass to the server
> 
> Basically, the client is responsible for putting connection IDs from the proxy into the connection on this side.

I don’t quite follow this case.

The proxy will be receiving packets from the server to the client on a socket that the proxy opens up to the server. Since this is a socket with a local port and address that the individual server can control, I don’t think it would normally need to use a CID that it selects for load balancing purposes.

The other reason to let the client choose its own CID that it represents to the server is that this allows the client to initiate an Initial packet in the first flight before it gets a response from the proxy.

Looking at the example again, the client tells the proxy about the CID it is sending to the client, and it also tells the proxy about the “virtual/mapped” CID that it wants the proxy to use on the leg back to the client.

STREAM(44): DATA                -------->
  Capsule Type = REGISTER_CLIENT_CID
  Connection ID = 0x31323334
  Virtual CID = 0x62646668
  Stateless Reset Token = Token

           <--------  STREAM(44): DATA
                        Capsule Type = ACK_CLIENT_CID
                        Connection ID = 0x31323334

If you see a need for the proxy to choose the actual CID, can you explain it in more detail?
 
> 
> 
> All of these are request-response exchanges, because the mapping will need to be clear.  Also, that same identifier can be used to remove connection IDs once the client or server retire them.  For that, I think that using the QUIC sequence number is fine as it might allow a bulk removal at the proxy if Retire Prior To is used.

Right, the REGISTER/ACK exchanges are all request and response pairs that are identified by a specific connection ID. If we want to add the extra sequence number in here, that could be fine too.
> 
> Things I didn't solve: connection ID limits (the proxy will want some, how does the client convey this?),

Do you mean the number of connect IDs the proxy is willing to understand and process? It can reject if a limit is exceeded, I think.

> removal messages (easy),

Indeed, the CLOSE capsules do this.

> and connection ID length constraints and the effect of different lengths on MTU (this should be minor, but it will need to be mapped out).

There is some text on the different lengths, but it can likely be expanded.
> 
> With this design, the proxy could move all forwarding logic to a load balancer and never touch packets again.  The load balancer only needs to support QUIC-LB for that to work (with encrypted connection IDs, of course).

The forwarding logic right now is something we put into eBPF on the same box, but if you have a way to program forwarding rules onto a different box that can also share the sockets that the proxies establish to the target servers, I could see this working. 

>  Of course, this will need to be revisited in my follow-up as the workload increases somewhat.

Is your follow-up a proposal on how to add an extra encryption layer, or something else?

Thanks,
Tommy
> 
> Cheers,
> Martin
> 
> -- 
> Masque mailing list
> Masque@ietf.org
> https://www.ietf.org/mailman/listinfo/masque