add initial support for network benchmarking with IPv6 #6285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Initial IPv6 (External IPs) Support
new 'assign_external_ipv6' flag to signal usage of IPv6 addresses when PKB creates networks/firewall rules/VMs (False by default)
added 'assign_external_ipv6' and 'ipv6_address' attributes to BaseVirtualMachine for storage of IPv6 addresses (parallel to existing 'assign_external_ip' and 'ip_address' attributes) (allows for dual-stack networking VMs)
define ShouldRunOnExternalIpv6Address() function to allow benchmarks to determine if they should attempt to perform runs with IPv6 addresses (parallel to ShouldRunOnInternalIpAddress() / ShouldRunOnExternalIpAddress())
define AllowIcmpIpv6() for BaseVirtualMachine & BaseFirewall, which should create necessary firewall rules to allow 'ICMP for IPv6' (protocol number 58) traffic
augment ping_benchmark.py to attempt ping runs with IPv6 addresses if appropriate
implement required functions in gce_network.py and gce_virtual_machine.py to allow for creation of dual-stack VMs with external IPv6 addresses when appropriate flag is set
Potential Issues
On GCP, 'gce_network_type' must be set to 'custom' to allow for the creation of subnets which support IPV4&IPV6 traffic. ('auto' mode creates subnets which only support IPv4) However, if --gce_network_type=custom, benchmark runs will fail for inter-region cases (ex: --zones=us-central1-c,us-east4-b). With current behavior, PKB will only create a subnet for the first VM/region.
So currently, a command like
will succeed, but the following will fail.
One way to 'side-step' this issue and run inter-region benchmarks with custom-mode VPC networks is to use vm_groups and specify CIDRs ranges for each group, but this creates a new VPC network for each group. The preferred behavior (imo) would be for PKB to 'manually' create the subnets for each zone in the 'zones' flag, rather than just the first one. (Another option could be to first create a VPC network in auto-mode, change it to custom-mode, and then update each subnet to the IPV4_IPV6 dual-stack type) I've held off on modifying this behavior for insight/guidance on what the preferred solution would be.
Example Run of Dual-Stack Ping benchmarks on GCP
Command:
Truncated Results (showing only 'Average Latency'):
As expected, PKB performs ping runs with external IPv4 and IPv6 addresses, ('using_ipv6' tag in the ping result output). Additionally, the IPv6 addresses for each VM is available in the all-test metadata.
Future Work and/or TODOs