From d281384966e65f397be84f2b0662b5e7cb131075 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Tue, 28 Feb 2023 20:44:56 +0000 Subject: [PATCH] quic: support half-way server's preferred address (#25356) Signed-off-by: Dan Zhang Mirrored from https://github.com/envoyproxy/envoy @ 245a0454ee6338414352a2bff7d0b3b7b532b0b5 --- BUILD | 1 + envoy/config/listener/v3/quic_config.proto | 11 +++++- .../quic/server_preferred_address/v3/BUILD | 12 +++++++ ...ixed_server_preferred_address_config.proto | 35 +++++++++++++++++++ versioning/BUILD | 1 + 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 envoy/extensions/quic/server_preferred_address/v3/BUILD create mode 100644 envoy/extensions/quic/server_preferred_address/v3/fixed_server_preferred_address_config.proto diff --git a/BUILD b/BUILD index 9635392e..3a38f547 100644 --- a/BUILD +++ b/BUILD @@ -268,6 +268,7 @@ proto_library( "//envoy/extensions/quic/connection_id_generator/v3:pkg", "//envoy/extensions/quic/crypto_stream/v3:pkg", "//envoy/extensions/quic/proof_source/v3:pkg", + "//envoy/extensions/quic/server_preferred_address/v3:pkg", "//envoy/extensions/rate_limit_descriptors/expr/v3:pkg", "//envoy/extensions/rbac/matchers/upstream_ip_port/v3:pkg", "//envoy/extensions/regex_engines/v3:pkg", diff --git a/envoy/config/listener/v3/quic_config.proto b/envoy/config/listener/v3/quic_config.proto index 42b5a6e5..3a8ce2cd 100644 --- a/envoy/config/listener/v3/quic_config.proto +++ b/envoy/config/listener/v3/quic_config.proto @@ -9,6 +9,8 @@ import "envoy/config/core/v3/protocol.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; +import "xds/annotations/v3/status.proto"; + import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -22,7 +24,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: QUIC listener config] // Configuration specific to the UDP QUIC listener. -// [#next-free-field: 9] +// [#next-free-field: 10] message QuicProtocolOptions { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.listener.QuicProtocolOptions"; @@ -68,4 +70,11 @@ message QuicProtocolOptions { // If not specified the :ref:`default one configured by ` will be used. // [#extension-category: envoy.quic.connection_id_generator] core.v3.TypedExtensionConfig connection_id_generator_config = 8; + + // Configure the server's preferred address to advertise so that client can migrate to it. See :ref:`example ` which configures a pair of v4 and v6 preferred addresses. + // The current QUICHE implementation will advertise only one of the preferred IPv4 and IPv6 addresses based on the address family the client initially connects with, and only if the client is also QUICHE-based. + // If not specified, Envoy will not advertise any server's preferred address. + // [#extension-category: envoy.quic.server_preferred_address] + core.v3.TypedExtensionConfig server_preferred_address_config = 9 + [(xds.annotations.v3.field_status).work_in_progress = true]; } diff --git a/envoy/extensions/quic/server_preferred_address/v3/BUILD b/envoy/extensions/quic/server_preferred_address/v3/BUILD new file mode 100644 index 00000000..ec1e778e --- /dev/null +++ b/envoy/extensions/quic/server_preferred_address/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "@com_github_cncf_udpa//udpa/annotations:pkg", + "@com_github_cncf_udpa//xds/annotations/v3:pkg", + ], +) diff --git a/envoy/extensions/quic/server_preferred_address/v3/fixed_server_preferred_address_config.proto b/envoy/extensions/quic/server_preferred_address/v3/fixed_server_preferred_address_config.proto new file mode 100644 index 00000000..b500263a --- /dev/null +++ b/envoy/extensions/quic/server_preferred_address/v3/fixed_server_preferred_address_config.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package envoy.extensions.quic.server_preferred_address.v3; + +import "xds/annotations/v3/status.proto"; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.quic.server_preferred_address.v3"; +option java_outer_classname = "FixedServerPreferredAddressConfigProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/quic/server_preferred_address/v3;server_preferred_addressv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: QUIC server preferred address config] +// [#extension: envoy.quic.server_preferred_address.fixed] + +// Configuration for FixedServerPreferredAddressConfig. +message FixedServerPreferredAddressConfig { + // [#comment:TODO(danzh2010): discuss with API shepherds before removing WiP status.] + + option (xds.annotations.v3.message_status).work_in_progress = true; + + oneof ipv4_type { + // String representation of IPv4 address, i.e. "127.0.0.2". + // If not specified, none will be configured. + string ipv4_address = 1; + } + + oneof ipv6_type { + // String representation of IPv6 address, i.e. "::1". + // If not specified, none will be configured. + string ipv6_address = 2; + } +} diff --git a/versioning/BUILD b/versioning/BUILD index 577a10e2..c2a9b860 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -207,6 +207,7 @@ proto_library( "//envoy/extensions/quic/connection_id_generator/v3:pkg", "//envoy/extensions/quic/crypto_stream/v3:pkg", "//envoy/extensions/quic/proof_source/v3:pkg", + "//envoy/extensions/quic/server_preferred_address/v3:pkg", "//envoy/extensions/rate_limit_descriptors/expr/v3:pkg", "//envoy/extensions/rbac/matchers/upstream_ip_port/v3:pkg", "//envoy/extensions/regex_engines/v3:pkg",