Skip to content

Adds In-Memory Peer Metadata Exchange In Istio PMX Filters#46045

Open
grnmeira wants to merge 2 commits into
envoyproxy:mainfrom
grnmeira:pmx-using-tls-between-filters
Open

Adds In-Memory Peer Metadata Exchange In Istio PMX Filters#46045
grnmeira wants to merge 2 commits into
envoyproxy:mainfrom
grnmeira:pmx-using-tls-between-filters

Conversation

@grnmeira

@grnmeira grnmeira commented Jul 8, 2026

Copy link
Copy Markdown
Member

Commit Message: Adds In-Memory Peer Metadata Exchange In Istio PMX Filters
Additional Description:

Istio uses network filters to communicate upstream peer information in the downstream direction. That's done because of current Envoy restrictions on filter state flow direction, that being only allowed in the upstream direction.

Give that constraint, the first PMX baggage filters used in Istio Ambient scenarios implemented this upstream -> downstream communication injecting information in the stream data itself. That worked because usually the two filters trying to communicate sit between a raw internal socket (io_stream_handler). Though, for cases where that socket incorporates TLS or PROXY protocol encoding/decoding, that becomes a problem as the injected data breaks encoding/decoding process.

This PR introduces that information exchange "out of the wire", using a combination between filter state and Envoy's thread local storage system.

It works like this:

  • The filter sitting in the downstream arranges a unique key (at the moment the downstream connection ID) and passes that on to the upstream filters.
  • The filter sitting in the upstream side, will read that filter state and obtain the unique key.
  • When peer metadata information comes from upstream, the filter sitting in the upstream, which now has the unique key, will use the key to index a peer info entry in the thread local storage.
  • When the downstream reads data coming from upstream, it now can check the thread local storage using the unique key to access upstream peer information.

Risk Level: Low, as it's isolated to Istio contrib filters
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Gustavo <grnmeira@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants