About Private Service Connect port mapping (original) (raw)

This page provides an overview of Private Service Connect port mapping.

Private Service Connect port mapping lets consumer virtual machine (VM) instances privately communicate with specific service ports on specific producer VMs through a single Private Service Connect endpoint.

A service consumer sends traffic to various client destination ports of the endpoint. Private Service Connect uses producer-defined mappings to forward traffic to the specified service port and producer VM. In some networking contexts, this approach is also known as port forwarding.

Port mapping versus regular Private Service Connect

Managed services are often designed as clusters of VMs, where different VMs represent separate instances of the same service. Every VM exposes the same operations on the same ports. For example, a database service might use port 1000 for database read operations and port 2000 for database write operations. Consumer VMs communicate with specific service instances by targeting ports on the VMs that are associated with the service instance.

A regular (load balanced) connection between aPrivate Service Connect endpointand aservice attachmentis not ideal for this situation. With a regular Private Service Connect connection, consumer VMs send traffic to one or more ports of the endpoint's IP address. All traffic is load balanced and sent to any healthy producer VM that is configured as a backend for the port that receives the traffic.

In contrast, Private Service Connect port mapping eliminates load balancing. This approach lets consumer VMs target specific service ports of specific producer VMs based on the client destination port that receives the traffic.

Private Service Connect port mapping forwards traffic from client destination ports of an endpoint to service ports of producer VMs based on mapping that is configured for a port mapping NEG (click to enlarge).

Private Service Connect port mapping lets consumer VMs communicate with specific producer VMs through the following process:

  1. The consumer VM sends packets to the endpoint's IP address, using a designated client destination port. The client destination port acts as a unique identifier for the packet's intended destination VM and port.
  2. Private Service Connect uses the mapping of the client destination port that receives the traffic to determine the packet's destination.
  3. Private Service Connect forwards the traffic to its destination VM and service port.

For example, in figure 1, packets are forwarded as follows:

Deployment

Deploying a Private Service Connect port mapping connection differs from deploying a regular Private Service Connect endpoint connection for published services in the following ways:

  1. The service producer creates a port mapping service. Port mapping services use port mapping network endpoint groups (NEGs). This configuration is similar to an internal passthrough Network Load Balancer, but traffic is not load balanced.
  2. The service producerconfigures the port mapping NEG's network endpointsto specify mappings from client destination ports of a Private Service Connect endpoint to service ports of specific producer VMs.
  3. The service producer creates a service attachment that is associated with the forwarding rule of their port mapping service.
  4. The service producer shares client destination ports and their mappings with the service consumer. This is not handled automatically by Google Cloud.
  5. The service consumer configures workloads to communicate with managed services by using the producer-defined port mappings.

Specifications

Private Service Connect port mapping has the following specifications:

Limitations

Use load balancing with Private Service Connect port mapping

Private Service Connect port mapping forwards traffic based solely on the client destination port that receives the traffic. If you want to use load balancing with Private Service Connect port mapping, you can do the following:

Quotas

For information about quotas and limits related to Private Service Connect port mapping, seeQuotas and limits.

Pricing

Pricing for Private Service Connect is described on theVPC pricing page.

What's next