[TLS] Re: 【Reply to the comments after the presentation in Montreal】RE: Re: FW: New Version Notification for draft-wang-tls-service-affinity-00.txt

Eric Rescorla <ekr@rtfm.com> Fri, 26 December 2025 23:57 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@mail2.ietf.org
Delivered-To: tls@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 12BED9FA7B6C for <tls@mail2.ietf.org>; Fri, 26 Dec 2025 15:57:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20230601.gappssmtp.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KP5_wfC9WJy7 for <tls@mail2.ietf.org>; Fri, 26 Dec 2025 15:57:23 -0800 (PST)
Received: from mail-yx1-xb136.google.com (mail-yx1-xb136.google.com [IPv6:2607:f8b0:4864:20::b136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id AD6209FA7B55 for <tls@ietf.org>; Fri, 26 Dec 2025 15:57:23 -0800 (PST)
Received: by mail-yx1-xb136.google.com with SMTP id 956f58d0204a3-64306a32ed2so6411478d50.2 for <tls@ietf.org>; Fri, 26 Dec 2025 15:57:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20230601.gappssmtp.com; s=20230601; t=1766793443; x=1767398243; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ge+XB+BmU4DHcwTelzNxqSpb4fF/k1Nc7JHWc5stnUk=; b=uSt5xrTWLwRWgVXzMHafS43/a4QQU1sFsiVhblSRO/ZliyY/R6YNZBB8Ln1Hy+QBhM jVKa4dJHJHE3ObIQ6seIzpcHCfBrFp8NByIJmpxMq4JMQt9VFxodskqZdVRKVVF3Z6M8 5bWykMUsLO6/GFsPrZOJNx2Ne34bBxVNRwQpcsxr2FH7zKppn056LP2TUjWFFtE6Vpji +UcAc/cK6pmmHSRchNgm4X8ERFiPhoJSyT2Xjp5uaF3VczIQu0HEkX8KCM86/NyGoEsy 6M7MBmmdU1TQi3O6xigVqh3wPukQWE173iQ6P+z46EMXXZpEPlsoiMvD2iV7M6qsJdX9 uvoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766793443; x=1767398243; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ge+XB+BmU4DHcwTelzNxqSpb4fF/k1Nc7JHWc5stnUk=; b=abIHVzCbMAz/vTcRkGfZstqv5sQrUqLisRjUlqvNImqZIoOBbilQ9hrKotuaF9WQTf 3mfkYFLc4dyDbeoY/IATWQuuYGGUVnviG7X2GcYVD95GiZbQ71Q6P/4qWXKdeB8ZJv1p G21+Pb6V2cD8H143eXPeQ5lKTcxaCm/IU8ID6MrK7sOT7xmfJ7xPegeq7P6Jy0yo01ix rvnCcPUa9VNP3U5+5YfXJyfjdbIokzdg8kfXqQ7LZa7xmLgpbqOEo3PDaFU50ZKP1tnN AquqBJmkQJhr/4E4r86wvqpBKsks/rK+TVrb9QHSQPssHXPEBD5rESPxhd9G00uOEBoW XtgA==
X-Forwarded-Encrypted: i=1; AJvYcCVzmXNX1KeQ5pwzDjXk/knptU7eZ4TEVc0VGwKxOF53IfVKvcyWT53RdQX1/OkLt5ZoQgs=@ietf.org
X-Gm-Message-State: AOJu0YyOsSJKgU2TiNqejh7ZR9OqH7WSmtpODykfF9InQE32zfHRdazq YgV+9vILpUPyRNJ0uOznCVxk3woHlkyTm40oWz8Z8pPwjLHTaWTSkrjwUudMgwwvRJBk/8NduDP 13CEwwFiA/nGp7gHmX4AIEa77s0SlOZJ+Wv+LVZ4ecKcY8f84hfIX6es=
X-Gm-Gg: AY/fxX5FJei1cufwpuDmUCGYAqXX5JMTeqlw14Py+U36p9w53ZxFDRWRwKE+CN+E6Dw 66RQzK2pkZ4jkKwmgpwj/0L7HhRRsS/KX6p58t1NuJb0tgvg4a4QilUL9LRR/Mo+nJfBjuDTqA/ ad8Y76ECS04SlsGjiZmiz/ucwHgpdQDMBo+Y8DJYX9rguY/3jQLD2JI+TBoXSJTNbqhrnek5UGY Ts+azD+ID7A9desmAE9xCENmjCwoK3KGjdTaHTbS27qYZGUuRPOj7FZxPyuKJqJnQt0wZnuekll 60+99NrrVSyT4YkgdmXz81p5Jd1Uh+gWhNINHmGYc6+B6/qA7NeadxKtG3mJVJqSHC+3MKc1TE1 UEobYa4S6lA==
X-Google-Smtp-Source: AGHT+IGcmc7PDuBmXzqgV3MnR68bjZV2uu8qYwqhfzT4Xux7Cmb+pciOw96lEGMg31I/3PzhBYn/rwEHseEFlvA6Yh4=
X-Received: by 2002:a05:690e:5cf:b0:646:518b:8f8a with SMTP id 956f58d0204a3-6466a834604mr15058860d50.18.1766793442991; Fri, 26 Dec 2025 15:57:22 -0800 (PST)
MIME-Version: 1.0
References: <000001dc7615$cf415b70$6dc41250$@tsinghua.org.cn>
In-Reply-To: <000001dc7615$cf415b70$6dc41250$@tsinghua.org.cn>
From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 26 Dec 2025 15:56:46 -0800
X-Gm-Features: AQt7F2pHaZEccZEStO_DenPoZcc40vP1ckqZ0tfplTg0Oi-_0dNykGJgygyr9Z4
Message-ID: <CABcZeBM=59id8msEU2i=qQXiwNKZnHTBAJ85zmEKD8USQF5z_w@mail.gmail.com>
To: Aijun Wang <wangaijun@tsinghua.org.cn>
Content-Type: multipart/alternative; boundary="0000000000008fac490646e3a77a"
Message-ID-Hash: HKUWNAJLV4CHQXKOCC3AGH75UNOYASWR
X-Message-ID-Hash: HKUWNAJLV4CHQXKOCC3AGH75UNOYASWR
X-MailFrom: ekr@rtfm.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tls.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: tls@ietf.org, draft-wang-tls-service-affinity@ietf.org, Mohit Sahni <msahni@paloaltonetworks.com>, Aijun Wang <wangaj3@chinatelecom.cn>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [TLS] Re: 【Reply to the comments after the presentation in Montreal】RE: Re: FW: New Version Notification for draft-wang-tls-service-affinity-00.txt
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/9VZlmdp31XAfJbfVOtMMvxfP48I>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Owner: <mailto:tls-owner@ietf.org>
List-Post: <mailto:tls@ietf.org>
List-Subscribe: <mailto:tls-join@ietf.org>
List-Unsubscribe: <mailto:tls-leave@ietf.org>

On Thu, Dec 25, 2025 at 7:14 PM Aijun Wang <wangaijun@tsinghua.org.cn>
wrote:

> Hi, Eric and Martin:
>
>
>
> During my presentation in IETF 124 meeting for this service affinity
> proposal, you raised the following questions that can be summarized as the
> followings:
>
> 1)    How to assure there is no application data loss during the switch
> take place?
>
> 2)    How to keep the application unware about the switchover, because
> the TCP connection switchover?
>
>
>
> Regarding to the question 1), after discussing with some experts offline,
> we think:
> 1.1) TLS is based on TCP, and the TCP layer can assure the application
> data be transferred successfully to the peer, based on the TCP ACK
> mechanism.
> 1.2) The client can decide when to switchover, based on the peer’s TCP ACK.
> 1.3) If some application data comes to the client during the switchover,
> the client can store them temporarily. This is local implementation
> consideration, needs not the extension of the protocol.
>

I'm not sure that this is quite correct about the concerns MT and I
were raising, so let me try to clarify.

Consider a simple HTTP REST API.

Client                                                  Server

POST /make-payment  ----------------------------------------->
                                              [Process payment]
<------------------------------------------------------ 200 OK

When the client receives a 200 OK, it knows that the request
has been processed. If it doesn't, it has to assume it has not.
For instance, consider the following case:


Client                                                  Server

POST /make-payment  ----------------------------------------->
                                              [Process payment]
                                              [Server crashes]
[TCP retransmit] -------------------------------------------->
<--------------------------------------------------------- RST

In this case, the client doesn't know what has happened. You need
mechanisms either at the HTTP layer--or more typically at the REST API
layer--to do the right thing, which might be an idempotency layer
combined with client-side retransmit.  This is all just a
straightforward application of the end-to-end argument, and there's no
real way around it as long as systems might asynchronously fail, but
it's also a source of defects (think about how many times sites tell
you not to press the submit button twice) because these mechanisms may
not have been exercised or tested. For instance, if the server is high
reliability and the client just assumes that anything it sent works,
that will be good enough a very large fraction of the time, but not if
the server has a high failure rate.


This brings us to your proposed mechanism, in which the server sends
an indication that you should do a switchover, and then the client
does it. The base case of this looks something like the following:

Client                                                  Server

<------------------ First TCP/TLS Connection ---------------->
POST /make-payment  ----------------------------------------->
                                              [Process payment]
<------------------------------------------------------ 200 OK
<----------------------------------------------- Switch servers

<-------------------- New TCP/TLS Connection ---------------->
POST /something-else ---------------------------------------->
<------------------------------------------------------ 200 OK


This is fine, but now consider what happens if the server sends its
request to switch immediately and so the client's request and the
server's request to switch cross in transit, like so:


Client                                                  Server

<------------------ First TCP/TLS Connection ---------------->
POST /make-payment ---------\ /---------------- Switch servers
                             X
<---------------------------/ \------------------------------>


Until the client receives the 200 OK, it has no way of knowing that
the server has processed the request, so the right thing to do is is
to wait until that 200 OK is received, because otherwise you have
created exactly the issue discussed above, where you're counting on
the application retry logic to be right on both the client and the
server; and because this happens a lot we're risking a lot of new
errors.

Unfortunately, these transaction semantics only exist at the HTTP
layer, not the TLS layer, so the TLS layer has no way of knowing to
wait for the 200 OK, it just knows that the client sent some data, but
not whether that reflects an outstanding request or something else;
recall that TLS doesn't even know about the HTTP request/response
semantics, because it's just a dumb pipe.


In your email, you suggest that the client ought to:

1. Wait for the server's TCP ACK of all transmitted data, with the
implied semantics being that once the message is ACKed it will be
reliably delivered to the server, not just to the TCP stack.
2. Buffer any data it receives form the cleint while waiting for the
ACK and retransmit it on the new connections.

This is a pretty big layering violation, but I don't believe that this
will work either, because we don't know that the client's flight was
complete. Suppose instead that we have a situation where the client's
request is in two parts and the first one and the server's request
cross in transmission. In that case, we might get this:

Client                                                  Server

<------------------ First TCP/TLS Connection ---------------->
POST /make-payment (1/2) ---\ /---------------- Switch servers
                             X
<---------------------------/ \------------------------------>
[Buffer /make-payment (2/2)]
<--------------------------------------------------------  ACK

<-------------------- New TCP/TLS Connection ---------------->
/make-payment (2/2) ----------------------------------------->


In this case, the server won't process the first half of the request
(probably), and the second half of the request isn't even validly
formed HTTP, so we've got a mess. The only thing that will work
here is that the client retries the POST in totality, but we're back
to the situation above, and in neither case do we want to buffer
and re-send the second half of the request.

Here too, the problem is that the semantics are only known at the HTTP
layer, and the TLS layer doesn't know them, so it can't do the right
thing. By contrast, if you do the switchover at the application layer,
it can pick an appropriate timepoint where there is no ambiguity
about the client and server state and proceed appropriately.

-Ekr


> Regarding to question 2), we think:
> 2.1) The application runs on the TLS layer. If the TLS layer doesn’t
> notify the application during the switchover, the application needs not be
> aware for the underlying switchover
> 2.2) TLS layer should only keep the switchover as quickly as possible, for
> example, reuse the previous negotiated shared key etc, as we proposed in
> the draft.
> 2.3) The application needs just send the data to the same TLS instance.
>
> How about your concerns regarding to the above explanation?
>
> Should we include them into the document for further clarify if the above
> considerations is reasonable?
>
>
>
> Happy holiday to you all!
>
>
>
> Best Regards
>
>
>
> Aijun Wang
>
> China Telecom
>
>
>
> *From:* forwardingalgorithm@ietf.org [mailto:forwardingalgorithm@ietf.org]
> *On Behalf Of *Eric Rescorla
> *Sent:* Tuesday, October 28, 2025 4:13 AM
> *To:* Mohit Sahni <msahni@paloaltonetworks.com>
> *Cc:* Aijun Wang <wangaijun@tsinghua.org.cn>; tls@ietf.org;
> draft-wang-tls-service-affinity@ietf.org; Aijun Wang <
> wangaj3@chinatelecom.cn>
> *Subject:* [TLS] Re: FW: New Version Notification for
> draft-wang-tls-service-affinity-00.txt
>
>
>
>
>
>
>
> On Mon, Oct 27, 2025 at 1:02 PM Mohit Sahni <msahni@paloaltonetworks.com>
> wrote:
>
> Hi Eric,
>
> One concern regarding using HTTP Alt Svc is that this limits the solution
> to HTTP based application, however TLS based solution helps with other
> application protocols too e.g. FTP or SMTP or any other protocol that uses
> STARTTLS construct.
>
>
>
> Yes, I'm aware of that. However, for the reasons Indicated in my response
> upstream, I think it's a feature that it happen at the application layer in
> a protocol-specific fashion.
>
>
>
> -Ekr
>
>
>
>
>
> -Mohit
>
>
>
> On Sun, Oct 26, 2025 at 7:55 PM Aijun Wang <wangaijun@tsinghua.org.cn>
> wrote:
>
> Hi, Eric:
>
> Thanks for your comments.
> Your understanding of the overall procedure for this proposal is correct.
>
> But, as indicated by Usama and replied by Mohit, the detail procedures in
> Figure 2 of this document should be based on TLS 1.3
> https://urldefense.proofpoint.com/v2/url?u=https-3A__datatracker.ietf.org_doc_html_rfc8446-23section-2D2&d=DwIFaQ&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=J7DgfMyeL26OZuy8d3qTy_h24Ff1NatxSKMgDUj2Kxg&m=S278vH9k736nF13K7hekoC9UmWiLbx5bPpySG6AG0wl-GJWmZBEH76RXKh178Prx&s=B0_YVjIgvDRP9AWMrgVcHGU594aeWIXGEZAZqvD8Liw&e=
> If there is any misunderstanding due to the above ignorance, let's discuss
> further based on our future update based on TLS 1.3
>
> Anyway, I try to explain our considerations in more detail inline below.
>
> Best Regards
>
> Aijun Wang
> China Telecom
>
> -----Original Message-----
> From: forwardingalgorithm@ietf.org [mailto:forwardingalgorithm@ietf.org]
> On Behalf Of 【外部账号】 Eric Rescorla
> Sent: Saturday, October 25, 2025 1:24 AM
> To: Aijun Wang <wangaijun@tsinghua.org.cn>
> Cc: tls@ietf.org; draft-wang-tls-service-affinity@ietf.org
> Subject: Re: [TLS] FW: New Version Notification for
> draft-wang-tls-service-affinity-00.txt
>
> Document: draft-wang-tls-service-affinity-00.txt
>
> I'm a little confused about the requirements driving this design.
>
> At a high level, it seems to me that you have the following set of
> events:
>
> 1. The client connects to the server using TLS via an anycast address
>    A1.
> 2. The server tells the client that it can/should be reached
>    at a new non-anycast address A2.
> 3. The client reconnects to the server at A2.
> 【WAJ】Yes
>
> I would make several points.
>
> First, the mechanism you propose seems heavyweight for this purpose.
> In particular, I don't understand why you need any authentication at all
> for the new address indication (the MigrationToken) because the client is
> going to authenticate to the server via normal TLS mechanisms. Recall that
> TLS is designed for a Dolev-Yao style attacker and doesn't trust the
> network at all, including the binding of DNS name to IP address; even if
> the client were provided with a completely false IP address for the server
> this would not allow impersonation of the server.
> 【WAJ】The "Migration_Token" is manly used to bind the new connection to
> the previous session.
>
> Second, I don't understand why you need the server to validate the
> MigrationToken. What properties are being bound to this token? It seems
> better to just bind whatever properties those are into the session ticket
> and treat this as a new connection.
> 【WAJ】The main properties in "Migration_Token" is the session_id, which
> can be used to lookup the previous negotiated PSK. Such design can
> eradicate the new PSK negotiation procedure.
>
> Third, I'm skeptical that the TLS layer is the right place to do this kind
> of migration, because you have race conditions where one side initiates a
> migration and the other side has outstanding data which will never be
> processed. These kinds of issues need to be resolved at the application
> layer, which is also a more convenient layer to initiate migration.
> 【WAJ】The initial purpose is to switch the address ASAP. There may be some
> race conditions(would you like to illustrate some?) and extra signal may be
> necessary later to refine the switchover.
>
> Overall, ISTM that a better design would be to just use something like
> HTTP Alt-Svc to steer the client to a different address, rather than doing
> this at the TLS layer. If you disagree, I think it would be helpful to
> explain the requirements that lead to this design.
> 【WAJ】Before proposing the switchover at TLS layer, we have analyzed the
> other possible solutions, for example, via application load balance, http
> redirection and DNS redirection(please review
> https://urldefense.proofpoint.com/v2/url?u=https-3A__datatracker.ietf.org_doc_html_draft-2Dwang-2Dtls-2Dservice-2Daffinity-2D00-23name-2Dintroduction&d=DwIFaQ&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=J7DgfMyeL26OZuy8d3qTy_h24Ff1NatxSKMgDUj2Kxg&m=S278vH9k736nF13K7hekoC9UmWiLbx5bPpySG6AG0wl-GJWmZBEH76RXKh178Prx&s=wjYYFdlQkm_hyIPH5wlCSjErLDcYyWrJ_FkapLN_7k0&e=
> ).
>    The reason that we propose the switchover at TLS layer, due to the
> optimization selection decision is made at the network itself(together with
> the availability of server resource), not at the application layer. The
> application is difficult to know which is the best server that can match
> the client's QoS requirements.(we call it the combination optimization
> process, which is the goal of the CATS WG).
>     And, actually, QUIC has also such migration process:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__datatracker.ietf.org_doc_html_rfc9000-23name-2Dconnection-2Dmigration&d=DwIFaQ&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=J7DgfMyeL26OZuy8d3qTy_h24Ff1NatxSKMgDUj2Kxg&m=S278vH9k736nF13K7hekoC9UmWiLbx5bPpySG6AG0wl-GJWmZBEH76RXKh178Prx&s=IhoM_hlC_ptCYdMMOa72ZAogUt3qS7ywnXCGgH8gpWA&e=
>
>
> -Ekr
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Tue, Oct 21, 2025 at 2:10 AM Aijun Wang <wangaijun@tsinghua.org.cn>
> wrote:
>
> > Hi, All:
> >
> > We have submitted one new draft regarding to the service affinity
> > function for TLS based application.
> > We are also applying the time slot for the presentation on the coming
> > IETF
> > 124 meeting.
> >
> > Wish to get your comments/suggestions on this topic before the
> > meeting, and we can also discuss further during the on-site meeting.
> >
> > Best Regards
> >
> > Aijun Wang
> > China Telecom
> >
> > -----Original Message-----
> > From: internet-drafts@ietf.org [mailto:internet-drafts@ietf.org]
> > Sent: Friday, October 17, 2025 4:34 PM
> > To: Aijun Wang <wangaj3@chinatelecom.cn>; Ketul Sheth <
> > ksheth@paloaltonetworks.com>; Mohit Sahni
> > <msahni@paloaltonetworks.com>; Wei Wang <weiwang94@foxmail.com>
> > Subject: New Version Notification for
> > draft-wang-tls-service-affinity-00.txt
> >
> > A new version of Internet-Draft draft-wang-tls-service-affinity-00.txt
> > has been successfully submitted by Wei Wang and posted to the IETF
> repository=
>
>