이 페이지에서는 Private Service Connect 포트 매핑을 간략하게 설명합니다.
Private Service Connect 포트 매핑을 사용하면 소비자 가상 머신(VM) 인스턴스가 단일 Private Service Connect 엔드포인트를 통해 특정 프로듀서 VM의 특정 서비스 포트와 비공개적으로 통신할 수 있습니다.
서비스 소비자는 엔드포인트의 다양한 클라이언트 대상 포트로 트래픽을 전송합니다. Private Service Connect는 프로듀서가 정의한 매핑을 사용하여 지정된 서비스 포트 및 프로듀서 VM으로 트래픽을 전달합니다. 일부 네트워킹 컨텍스트에서는 이 접근 방식을 포트 전달이라고도 합니다.
포트 매핑과 일반 Private Service Connect 비교
관리형 서비스는 대개 VM 클러스터로 설계되며, 여기서 서로 다른 VM은 동일한 서비스의 별도 인스턴스를 나타냅니다. 모든 VM은 동일한 포트에서 동일한 작업을 노출합니다. 예를 들어 데이터베이스 서비스는 데이터베이스 읽기 작업에 포트 1000을, 데이터베이스 쓰기 작업에 포트 2000을 사용할 수 있습니다. 소비자 VM은 서비스 인스턴스와 연결된 VM의 포트를 타겟팅하여 특정 서비스 인스턴스와 통신합니다.
Private Service Connect 엔드포인트와 서비스 연결 간의 일반(부하 분산) 연결은 이 상황에 적합하지 않습니다. 일반 Private Service Connect 연결을 사용하면 소비자 VM은 엔드포인트 IP 주소의 하나 이상의 포트로 트래픽을 전송합니다. 모든 트래픽은 부하 분산되고 트래픽을 수신하는 포트의 백엔드로 구성된 정상 프로듀서 VM으로 전송됩니다.
반면 Private Service Connect 포트 매핑은 부하 분산을 제거합니다. 이 접근 방식을 사용하면 소비자 VM은 트래픽을 수신하는 클라이언트 대상 포트를 기반으로 특정 프로듀서 VM의 특정 서비스 포트를 타겟팅할 수 있습니다.
Private Service Connect 포트 매핑은 포트 매핑 NEG에 구성된 매핑을 기반으로 엔드포인트의 클라이언트 대상 포트에서 프로듀서 VM의 서비스 포트로 트래픽을 전달합니다(확대하려면 클릭).
Private Service Connect 포트 매핑을 사용하면 다음 프로세스를 통해 소비자 VM이 특정 프로듀서 VM과 통신할 수 있습니다.
소비자 VM은 지정된 클라이언트 대상 포트를 사용하여 엔드포인트의 IP 주소로 패킷을 전송합니다. 클라이언트 대상 포트는 패킷의 의도된 대상 VM 및 포트에 대한 고유 식별자 역할을 합니다.
Private Service Connect는 트래픽을 수신하는 클라이언트 대상 포트의 매핑을 사용하여 패킷의 대상을 결정합니다.
Private Service Connect는 트래픽을 대상 VM 및 서비스 포트로 전달합니다.
예를 들어 그림 1에서는 패킷이 다음과 같이 전달됩니다.
엔드포인트의 클라이언트 대상 포트 1001로 전송된 패킷은 vm-1의 서비스 포트 1000으로 전달됩니다.
엔드포인트의 클라이언트 대상 포트 1002으로 전송된 패킷은 vm-1의 서비스 포트 2000으로 전달됩니다.
엔드포인트의 클라이언트 대상 포트 1003으로 전송된 패킷은 vm-2의 서비스 포트 1000으로 전달됩니다.
엔드포인트의 클라이언트 대상 포트 1004로 전송된 패킷은 vm-2의 서비스 포트 2000으로 전달됩니다.
배포
Private Service Connect 포트 매핑 연결을 배포하는 것은 게시된 서비스에 대한 일반 Private Service Connect 엔드포인트 연결을 배포하는 것과 다음과 같은 점에서 다릅니다.
서비스 프로듀서가 포트 매핑 서비스를 만듭니다. 포트 매핑 서비스는 포트 매핑 네트워크 엔드포인트 그룹(NEG)을 사용합니다.
이 구성은 내부 패스 스루 네트워크 부하 분산기와 유사하지만 트래픽은 부하 분산되지 않습니다.
서비스 프로듀서는 포트 매핑 NEG의 네트워크 엔드포인트를 구성하여 Private Service Connect 엔드포인트의 클라이언트 대상 포트에서 특정 프로듀서 VM의 서비스 포트에 대한 매핑을 지정합니다.
서비스 프로듀서는 포트 매핑 서비스의 전달 규칙과 연결된 서비스 연결을 만듭니다.
서비스 프로듀서는 클라이언트 대상 포트와 해당 매핑을 서비스 소비자와 공유합니다. 이는 Google Cloud에서 자동으로 처리되지 않습니다.
서비스 소비자는 프로듀서가 정의한 포트 매핑을 사용하여 관리형 서비스와 통신하도록 워크로드를 구성합니다.
사양
Private Service Connect 포트 매핑의 사양은 다음과 같습니다.
Private Service Connect 포트 매핑 연결을 사용하려면 소비자 VPC 네트워크에 있는 Private Service Connect 엔드포인트가 프로듀서 VPC 네트워크의 서비스 연결에 연결되어야 합니다.
서비스 연결은 포트 매핑 서비스와 연결됩니다. 포트 매핑 서비스는 내부 패스 스루 네트워크 부하 분산기와 유사하게 구성되지만 트래픽은 부하 분산되지 않습니다. 포트 매핑 서비스는 다음으로 구성됩니다.
백엔드 서비스에 연결되는 전달 규칙입니다. 전달 규칙은 TCP 또는 UDP 트래픽에 대해 구성해야 합니다. 전달 규칙은 모든 클라이언트 대상 포트의 트래픽을 전달하도록 구성해야 합니다(예: Google Cloud CLI에서 --ports=ALL 지정). 하지만 사용할 클라이언트 대상 포트에 대한 매핑만 포트 매핑 NEG에서 정의하면 됩니다.
포트 매핑 네트워크 엔드포인트 그룹(NEG)을 사용하도록 구성된 백엔드 서비스입니다. 서비스 프로듀서는 포트 매핑 NEG의 네트워크 엔드포인트를 사용하여 Private Service Connect 엔드포인트의 클라이언트 대상 포트에서 서비스 포트와 프로듀서 VM의 조합에 대한 고유한 매핑을 정의합니다.
포트 매핑 서비스는 트래픽을 부하 분산하는 대신 포트 매핑 NEG에 구성된 매핑만을 기반으로 트래픽을 전달합니다.
프로듀서 서비스는 유효한 클라이언트 대상 포트와 각 매핑을 소비자와 공유해야 합니다.
Private Service Connect는 이 정보를 소비자와 공유하지 않습니다.
소비자는 프로듀서가 정의한 포트 매핑을 사용하여 관리형 서비스와 통신하도록 워크로드를 구성해야 합니다.
서비스의 전달 규칙에 전역 액세스가 사용 설정된 경우 소비자는 포트 매핑 서비스에 연결되는 엔드포인트에 전역 액세스를 사용 설정할 수 있습니다.
Private Service Connect 포트 매핑은 하이브리드 액세스를 지원합니다.
소비자의 온프레미스 워크로드는 Cloud Interconnect용 VLAN 연결 또는 Cloud VPN을 통해 Private Service Connect 엔드포인트에 액세스하여 프로듀서 VM에 연결할 수 있습니다.
Private Service Connect 포트 매핑은 포트 매핑 서비스에 연결되는 엔드포인트에 대해 전파된 연결(미리보기)을 지원합니다.
포트 매핑 서비스는 IPv4 또는 IPv6(미리보기) 주소를 사용하여 게시할 수 있습니다. 자세한 내용은 IP 버전 변환을 참조하세요.
제한사항
포트 매핑 NEG가 연결된 백엔드 서비스에는 상태 점검이 지원되지 않습니다. 유효성 검사는 백엔드 서비스에 포트 매핑 NEG가 있는 경우 상태 점검이 구성되지 않도록 차단합니다.
Private Service Connect 포트 매핑은 여러 서비스 연결 또는 동일한 포트 매핑 백엔드 서비스에 대한 전달 규칙을 지원하지 않습니다.
Private Service Connect 백엔드에서는 포트 매핑 서비스에 액세스할 수 없습니다.
Private Service Connect 포트 매핑으로 부하 분산 사용
Private Service Connect 포트 매핑은 트래픽을 수신하는 클라이언트 대상 포트만을 기반으로 트래픽을 전달합니다. Private Service Connect 포트 매핑으로 부하 분산을 사용하려면 다음을 수행하면 됩니다.
소비자에게 소비자 측에서 부하 분산을 구현하도록 요청합니다. 소비자 VM에서 실행되는 소프트웨어는 교체 클라이언트 대상 포트로 트래픽을 전송할 수 있습니다.
프로듀서 VPC 네트워크에 포트 매핑 서비스 대신 부하 분산기에 연결되는 두 번째 서비스 연결을 만듭니다. 부하 분산기의 백엔드 서비스에서 포트 매핑 NEG에 있는 것과 동일한 VM을 백엔드로 사용합니다. 소비자는 부하 분산이 필요한 트래픽을 두 번째 서비스 연결과 연결된 엔드포인트로 전송할 수 있습니다.
할당량
Private Service Connect 포트 매핑과 관련된 할당량 및 한도에 대한 자세한 내용은 할당량 및 한도를 참조하세요.
가격 책정
Private Service Connect의 가격은 VPC 가격 책정 페이지에 설명되어 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["About Private Service Connect port mapping\n\nThis page provides an overview of Private Service Connect port mapping.\n\nPrivate Service Connect port mapping lets consumer\nvirtual machine (VM) instances privately communicate with specific service ports\non specific producer VMs through a single Private Service Connect\nendpoint.\n\nA service consumer sends traffic to various client destination ports of the\nendpoint. Private Service Connect uses producer-defined mappings\nto forward traffic to the specified service port and producer VM. In some\nnetworking contexts, this approach is also known as port forwarding.\n\nPort mapping versus regular Private Service Connect\n\nManaged services are often designed as clusters of VMs, where\ndifferent VMs represent separate instances of the same service. Every VM\nexposes the same operations on the same ports. For example, a\ndatabase service might use port `1000` for database read operations and\nport `2000` for database write operations. Consumer VMs communicate with\nspecific service instances by targeting ports on the VMs that are associated\nwith the service instance.\n\nA regular (load balanced) connection between a\n[Private Service Connect endpoint](/vpc/docs/about-accessing-vpc-hosted-services-endpoints)\nand a\n[service attachment](/vpc/docs/about-vpc-hosted-services#service-attachments)\nis not ideal for this situation. With a regular\nPrivate Service Connect connection, consumer VMs send traffic to\none or more ports of the endpoint's IP address. All traffic is load balanced and\nsent to any healthy producer VM that is configured as a backend for the port\nthat receives the traffic.\n\nIn contrast, Private Service Connect port mapping eliminates\nload balancing. This approach lets consumer VMs target specific service ports\nof specific producer VMs based on the client destination port that receives\nthe traffic.\n[](/static/vpc/images/psc-port-mapping-overview.svg) 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).\n\nPrivate Service Connect port mapping lets consumer VMs communicate\nwith specific producer VMs through the following process:\n\n1. 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.\n2. Private Service Connect uses the mapping of the client destination port that receives the traffic to determine the packet's destination.\n3. Private Service Connect forwards the traffic to its destination VM and service port.\n\nFor example, in figure 1, packets are forwarded as follows:\n\n- Packets that are sent to client destination port `1001` of the endpoint are forwarded to service port `1000` of `vm-1`.\n- Packets that are sent to client destination port `1002` of the endpoint are forwarded to service port `2000` of `vm-1`.\n- Packets that are sent to client destination port `1003` of the endpoint are forwarded to service port `1000` of `vm-2`.\n- Packets that are sent to client destination port `1004` of the endpoint are forwarded to service port `2000` of `vm-2`.\n\nDeployment\n\nDeploying a Private Service Connect port mapping connection\ndiffers from deploying a regular Private Service Connect\nendpoint connection for published services in the following ways:\n\n1. The service producer creates a port mapping service. Port mapping services use [port mapping network endpoint groups (NEGs)](/vpc/docs/create-port-mapping-service#create-neg). This configuration is similar to an internal passthrough Network Load Balancer, but traffic is not load balanced.\n2. The service producer [configures the port mapping NEG's network endpoints](/vpc/docs/create-port-mapping-service?#add-endpoints) to specify mappings from client destination ports of a Private Service Connect endpoint to service ports of specific producer VMs.\n3. The service producer creates a service attachment that is associated with the forwarding rule of their port mapping service.\n4. The service producer shares client destination ports and their mappings with the service consumer. This is not handled automatically by Google Cloud.\n5. The service consumer configures workloads to communicate with managed services by using the producer-defined port mappings.\n\nSpecifications\n\nPrivate Service Connect port mapping has the following\nspecifications:\n\n- A Private Service Connect port mapping connection requires a Private Service Connect endpoint in a consumer VPC network that connects to a service attachment in a producer VPC network.\n- The service attachment is associated with a port mapping service. Port mapping services are configured similarly to internal passthrough Network Load Balancers, but traffic isn't load balanced. Port mapping services are composed of the following:\n - A [forwarding rule](/load-balancing/docs/forwarding-rule-concepts) that connects to a backend service. The forwarding rule must be configured for either `TCP` or `UDP` traffic. The forwarding rule must be configured to forward traffic for all client destination ports---for example, by specifying `--ports=ALL` in the Google Cloud CLI. However, you only need to define mappings in the port mapping NEG for the client destination ports that you plan to use.\n - A [backend service](/load-balancing/docs/backend-service) that is configured to use a [port mapping network endpoint group\n (NEG)](/load-balancing/docs/negs#port-mapping-neg). Service producers use the network endpoints of the port mapping NEG to define unique mappings from client destination ports of the Private Service Connect endpoint to a combination of service port and producer VM.\n- Instead of load balancing traffic, the port mapping service forwards traffic based solely on the mappings that are configured in the port mapping NEG.\n- The producer service must share the valid client destination ports and their respective mappings with the consumer. Private Service Connect doesn't share this information with the consumer.\n- The consumer must configure their workloads to communicate with managed services by using the producer-defined port mappings.\n- Consumers can enable [global\n access](/vpc/docs/about-accessing-vpc-hosted-services-endpoints#global-access) for endpoints that connect to port mapping services if global access is enabled on the service's forwarding rule.\n- Private Service Connect port mapping supports hybrid access. A consumer's on-premises workload can reach producer VMs by accessing the Private Service Connect endpoint through [VLAN attachments for\n Cloud Interconnect](/network-connectivity/docs/interconnect/concepts/overview) or [Cloud VPN](/network-connectivity/docs/vpn/concepts/overview).\n- Private Service Connect port mapping supports [propagated\n connections](/vpc/docs/about-propagated-connections#provision) ([Preview](https://cloud.google.com/products#product-launch-stages)) for endpoints that connect to port mapping services.\n- Port mapping services can be published by using either IPv4 or IPv6 ([Preview](https://cloud.google.com/products#product-launch-stages)) addresses. For more information, see [IP version\n translation](/vpc/docs/about-vpc-hosted-services#ip-version-translation).\n\nLimitations\n\n- Health checks are not supported on backend services that have port mapping NEGs attached to them. Validation blocks a health check from being configured if the backend service has a port mapping NEG.\n- Private Service Connect port mapping doesn't support connecting multiple service attachments or forwarding rules to the same port mapping backend service.\n- Port mapping services can't be accessed by Private Service Connect backends.\n\nUse load balancing with Private Service Connect port mapping\n\nPrivate Service Connect port mapping forwards traffic based solely\non the client destination port that receives the traffic. If you want to use\nload balancing with Private Service Connect port mapping, you can do\nthe following:\n\n- Ask the consumer to implement load balancing on the consumer side. Software that runs on consumer VMs can send traffic to alternating client destination ports.\n- Create a second service attachment in the producer VPC network that connects to a load balancer instead of a port mapping service. Use the same VMs that are in the port mapping NEG as backends in the load balancer's backend service. The consumer can send traffic that needs to be load balanced to an endpoint that is associated with the second service attachment.\n\nQuotas\n\nFor information about quotas and limits related to\nPrivate Service Connect port mapping, see\n[Quotas and limits](/load-balancing/docs/quotas).\n\nPricing\n\nPricing for Private Service Connect is described on the\n[VPC pricing page](/vpc/pricing#psc-forwarding-rules).\n\nWhat's next\n\n- [About accessing published services through endpoints](/vpc/docs/about-accessing-vpc-hosted-services-endpoints)\n- [Create port mapping services](/vpc/docs/create-port-mapping-service)"]]