ietf-tapswg / api-drafts Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CacheContext to architecture and API #244
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| @@ -346,7 +346,9 @@ The diagram below provides a high-level view of the actions taken during the lif | ||
|
|
||
| * Protocol Selection Properties: The Protocol Selection Properties consist of the options that an application may set to influence the selection of transport protocol, or to configure the behavior of generic transport protocol features. These options can take the form of requirements, prohibitions, and preferences. Examples include reliability, service class, multipath support, and fast open support. | ||
|
|
||
| * Specific Protocol Properties: The Specific Protocol Properties refer to the subset of Protocol Properties options that apply to a single protocol (transport protocol, IP, or security protocol). The presence of such Properties does not necessarily require that a specific protocol must be used when a Connection is established, but that if this protocol is employed, a particular set of options should then be used.. | ||
| * Specific Protocol Properties: The Specific Protocol Properties refer to the subset of Protocol Properties options that apply to a single protocol (transport protocol, IP, or security protocol). The presence of such Properties does not necessarily require that a specific protocol must be used when a Connection is established, but that if this protocol is employed, a particular set of options should then be used. | ||
|
|
||
| * Caching Context: The Caching Context defines the group of Preconnections, Connections, and Listeners that are allowed to share cached state. This cached state may influence establishment as well as heuristics used during the lifetime of a Connection. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, could quibble about the exact wording. I think there are two separate entities here that we need to deal with at the architectural level:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, could quibble about the exact wording. I think there are two separate entities here that we need to deal with at the architectural level:
|
||
|
|
||
| ### Establishment Actions {#establishment} | ||
|
|
||
| @@ -328,14 +328,15 @@ describes properties of a Connection that might exist in the future. This state | ||
| comprises Local Endpoint and Remote Endpoint Objects that denote the endpoints | ||
| of the potential Connection (see {{endpointspec}}), the Selection Properties | ||
| (see {{selection-props}}), any preconfigured Connection Properties | ||
| ({{connection-props}}), and the security parameters (see | ||
| {{security-parameters}}): | ||
| (see {{connection-props}}), the security parameters (see | ||
| {{security-parameters}}), and a cache context (see {{cache-context}}): | ||
|
|
||
| ~~~ | ||
| Preconnection := NewPreconnection(LocalEndpoint, | ||
| RemoteEndpoint, | ||
| TransportProperties, | ||
| SecurityParams) | ||
| SecurityParams, | ||
| CacheContext) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above -- not clear why we need to expose this up as something special beyond a feature of the transport services application context (does this have a name in this doc?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After discussion with Tommy in Bangkok: CacheContext should be an optional parameter. |
||
| ~~~ | ||
|
|
||
| The Local Endpoint MUST be specified if the Preconnection is used to Listen() | ||
| @@ -705,6 +706,65 @@ ChallengeCallback := NewCallback({ | ||
| SecurityParameters.SetIdentityChallengeCallback(challengeCallback) | ||
| ~~~ | ||
|
|
||
| ## Specifying Caching Context {#cache-context} | ||
|
|
||
| During the lifetime of Connection, the various protocols used may generate | ||
| state or statistics that can be cached to help optimize future Connections. | ||
| New Connections can then take advantage of this cached state to influence | ||
| connection establishment, tuning protocol heuristics, and resuming state. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/to influence connection establishment, tuning protocol heuristics, and resuming state/for connection establishment and protocol heuristic tuning. |
||
|
|
||
| Some examples of cached state include: | ||
|
|
||
| - DNS query answers may be cached for use in subsequent Connections | ||
| to the same hostname. | ||
|
|
||
| - TCP round-trip-time (RTT) metrics may be cached to tune delays for | ||
| protocol stack racing. | ||
|
|
||
| - TLS state may be cached for use in session resumption. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe drop a reference to RFC 5077? |
||
|
|
||
| Within a single application, there may need to be several distinct and separate | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/to be/to maintain? |
||
| caches to ensure that data and state is not shared between certain Connections. | ||
| Each Preconnection is therefore associated with a CacheContext, which defines | ||
| a distinct set of cached information. All Connections and Preconnections that are | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly add here, or in the implementation draft: Moreover, certain cache state may not be appropriate for re-use for all applications. For example, to improve privacy and limit client tracking, TLS 1.3 {{!RFC8446}} connection state should not be re-used absent early data to write, as this introduces an unnecessary tracking vector without saving any round trips. (It may however cost more CPU.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Bangkok we said that the default is that all sharing is allowed: If we do it like this, let's make it very explicit in the text: Alternatively, we could set the default that all state can be shared except TLS 1.3 connection state ...? |
||
| associated with a single CacheContext are allowed to share state. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd piggyback this with a blurb similar to the above, wherein we only want use that shared state if necessary. |
||
|
|
||
| A new CacheContext can be created and handed to one or more Preconnections. | ||
|
|
||
| ~~~ | ||
| CacheContext := NewCacheContext() | ||
| ~~~ | ||
|
|
||
| By default, a Preconnection is associated with an implicit CacheContext. This | ||
| context may be directly accessed if needed. | ||
|
|
||
| ~~~ | ||
| CacheContext := ImplicitCacheContext() | ||
| ~~~ | ||
|
|
||
| A custom CacheContext may be configured to set up policy for how it should | ||
| cache data. Setting any of these items on the implicit | ||
| CacheContext is an error. | ||
|
|
||
| ~~~ | ||
| CacheContext.SetDefaultEntryLifetime(SECONDS_PER_DAY) | ||
| CacheContext.SetTotalCapacity(MAX_CACHE_ELEMENTS) | ||
| ~~~ | ||
|
|
||
| A custom CacheContext may also be configured to disable all caching | ||
| for privacy-sensitive connections that should not preserve state. | ||
|
|
||
| ~~~ | ||
| CacheContext.SetDisableCaching(true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it's cleaner to give Preconnections a caching context that disables caching, or simply not give them a caching context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tend to have a global, singleton |
||
| ~~~ | ||
|
|
||
| If an application wants to flush all cached data in a context, it can invoke | ||
| a flush function. | ||
|
|
||
| ~~~ | ||
| CacheContext.Flush() | ||
| ~~~ | ||
|
|
||
| # Establishing Connections {#establishment} | ||
|
|
||
| Before a Connection can be used for data transfer, it must be established. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, could quibble about the exact wording.
I think there are two separate entities here that we need to deal with at the architectural level:
a "cached remote view" (I hate this term, but something that means the same thing), which is everything that an endpoint can remember about a remote endpoint it has associated with in the past. (This is largely equivalent to Post Sockets' Association, though there is a discussion to have about the extent to which Paths are bound to a cached remote view as opposed to the caching context as a whole.
a "caching context" as we have here, though there is a missing argument about why the caching context is not simply 1:1 contained within a transport services application context. (Indeed, I can't think of a good reason why it shouldn't be -- if the system can make inferences about paths from what it knows, why give the application special control over when it shouldn't)