포트 제어 프로토콜
포트 제어 프로토콜 개요
PCP(Port Control Protocol)는 NAT44 및 방화벽 디바이스와 같은 업스트림 디바이스에 의한 수신 패킷의 전달을 제어하는 방법과 애플리케이션 keepalive 트래픽을 줄이는 방법을 제공합니다. PCP는 MS-DPC, MS-100, MS-400 및 MS-500 MultiServices PIC에서 지원됩니다. Junos OS 릴리스 17.4R1부터 NAPT44용 PCP는 MS-MPC 및 MS-MIC에서도 지원됩니다. Junos 20.2R1부터 CGNAT DS-Lite 서비스용 PCP가 차세대 서비스에 지원됩니다.Junos OS 릴리스 18.2R1부터 MS-MPC 및 MS-MIC의 PCP는 DS-Lite를 지원합니다. Junos OS 릴리스 18.1 및 이전 릴리스에서 MS-MPC 및 MS-MIC의 PCP는 DS-Lite를 지원하지 않습니다.
PCP는 CGN(캐리어급 NAT)과 소형 NAT(예: 가정용 NAT)의 컨텍스트에서 구현되도록 설계되었습니다. PCP를 사용하면 호스트가 ISP에서 운영하는 CGN 뒤에 있을 때를 포함하여 NAT 디바이스 뒤에 있을 때 장시간(웹캠의 경우와 같이) 또는 짧은 시간(예: 게임 또는 전화 통화 중) 동안 서버를 운영할 수 있습니다. PCP를 사용하면 애플리케이션이 외부 IP 주소 및 포트에서 내부 IP 주소 및 포트로의 매핑을 생성할 수 있습니다. 이러한 매핑은 NAT 또는 방화벽 뒤에 있는 시스템으로 향하는 성공적인 인바운드 통신에 필요합니다. 들어오는 연결에 대한 매핑을 만든 후에는 들어오는 연결의 IP 주소와 포트에 대해 원격 컴퓨터에 알려야 합니다. 이 작업은 일반적으로 응용 프로그램별 방식으로 수행됩니다.
Junos OS는 PCP 버전 2 및 버전 1을 지원합니다.
PCP는 다음 구성 요소로 구성됩니다.
PCP 클라이언트 - 리소스를 획득하고 제어하기 위해 PCP 서버에 PCP 요청을 발행하는 호스트 또는 게이트웨이입니다.
PCP 서버 - 일반적으로 PCP 요청을 수신하고 처리하는 CGN 게이트웨이 또는 공동 배치 서버
Junos OS를 사용하면 포트 포워딩 및 포트 블록 할당과 같은 NAPT44 기능을 사용하여 플로우 매핑을 위한 PCP 서버를 구성할 수 있습니다. 흐름은 다음 소스에서 처리할 수 있습니다.
그림 1과 같이 사용자 장비에서 직접 수신된 PCP 요청을 포함하는 트래픽입니다.
그림 1: 기본 PCP NAPT44 토폴로지DS-Lite 소프트위어 개시자(B4) 역할을 하는 라우터에 의해 추가된 PCP 요청을 포함하는 트래픽 매핑. DS-Lite 일반 모드라고 하는 이 모드는 그림 2에 나와 있습니다.
그림 2: DS-Lite 일반 모드가있는 PCP
Junos OS는 PCP 시작 트래픽에 대한 결정론적 포트 블록 할당을 지원하지 않습니다.
포트 제어 프로토콜의 이점
많은 네트워크 주소 변환(NAT) 친화적 애플리케이션은 네트워크 주소 변환(NAT) 디바이스에 의해 세션 시간이 초과되지 않도록 애플리케이션 수준의 메시지를 자주 보냅니다. PCP는 다음과 같은 용도로 사용됩니다.
이러한 NAT keepalive 메시지의 빈도를 줄입니다.
가입자 액세스 네트워크의 대역폭 감소
서버에 대한 트래픽 감소
모바일 장치의 배터리 소모 감소
Port Control Protocol 버전 2
Junos OS 릴리스 15.1부터 RFC 6887을 준수하는 PCP(Port Control Protocol) 버전 2가 지원됩니다. PCP는 NAT44 및 방화벽 디바이스와 같은 업스트림 디바이스에 의한 수신 패킷의 전달을 제어하는 방법과 애플리케이션 keep-alive 트래픽을 줄이는 방법을 제공합니다. PCP 버전 2는 임시 인증을 지원합니다. PCP를 사용하면 애플리케이션이 외부 IP 주소 및 포트에서 내부 IP 주소 및 포트로의 매핑을 생성할 수 있습니다. nonce 페이로드는 재생 공격을 방지하며 명시적으로 비활성화되지 않는 한 기본적으로 전송됩니다.
버전 2 맵 요청(새로 고침 또는 삭제용)에 대한 클라이언트 nonce를 확인하려면 PCP 매핑을 생성하도록 하는 원래 맵 요청에서 수신된 nonce가 유지되어야 합니다. 매핑을 만들 수 있는 초기 요청의 버전도 유지됩니다. nonce 및 version 매개 변수를 저장하는 이 동작은 PCP 매핑당 13바이트가 사용됨을 나타냅니다. 이러한 스토리지 공간의 약간의 증가는 요청된 단일 맵핑에 대한 시스템의 현재 메모리 사용량과 일치할 때 중요하지 않습니다(함께 생성된 EIM(엔드포인트 독립 맵핑) 및 EIF(엔드포인트 독립 필터링) 고려). 고객 배포에서 PCP는 EIM 및 EIF 매핑이 이러한 모든 매핑의 일부를 나타내도록 합니다.
Junos 릴리스 15.1까지 서비스 PIC는 버전 1 메시지 인코딩을 사용하는 PCP 초안 버전 22에 따라 주니퍼 네트웍스 라우터에서 PCP 서버를 지원합니다. PCP가 포트 제어 프로토콜(PCP) draft-ietf-pcp-base-22(2012년 7월 만료) 에 정의된 초안 버전에서 RFC 6887 -- PCP(Port Control Protocol)에 정의된 최종 표준 버전으로 개선됨에 따라 메시지 인코딩이 버전 2로 변경되고 필요에 따라 피어 및 맵 요청을 인증하기 위해 임의의 임시 페이로드가 추가되었습니다. 버전 1은 버전 2 형식과 호환되는 메시지를 디코딩하지 않으며 nonce 인증이 지원되지 않습니다. 실제 네트워크 환경에서는 CPE(Customer Premises Equipment) 디바이스가 버전 2만 지원하는 경우가 늘어나면서 버전 2 메시지를 구문 분석하고 전송해야 합니다. 버전 1 지원 CPE 디바이스와의 하위 호환성이 유지되고(버전 협상은 표준의 일부임) v2 메시지가 사용 중일 때 요청 임시 페이로드 패킷을 인증합니다.
명령의 show services pcp statistics
출력에는 버전이 1 또는 2가 아닐 때마다 나타내기 위해 증가되는 PCP 지원되지 않는 버전 필드가 포함됩니다. 새 필드인 PCP request nonce does not match existing mapping(PCP 요청 논세가 기존 매핑과 일치하지 않음)이 도입되어 nonce 페이로드가 매핑에 기록된 것과 일치하지 않아 무시된 PCP 버전 2 요청 수를 나타냅니다(인증 실패). 버전 2가 사용 중인 경우 클라이언트 nonce가 인증에 사용됩니다.
포트 제어 프로토콜 구성
이 주제에서는 PCP(Port Control Protocol)를 구성하는 방법에 대해 설명합니다. PCP는 MS-DPC, MS-100, MS-400 및 MS-500 MultiServices PIC에서 지원됩니다. Junos OS 릴리스 17.4R1부터 NAPT44용 PCP는 MS-MPC 및 MS-MIC에서도 지원됩니다. Junos OS 릴리스 18.2R1부터 MS-MPC 및 MS-MIC의 PCP는 DS-Lite를 지원합니다. Junos OS 릴리스 18.1 및 이전 릴리스에서 MS-MPC 및 MS-MIC의 PCP는 DS-Lite를 지원하지 않습니다. Junos OS 릴리스 20.2R1부터 PCP는 CGNAT 서비스용 MX-SPC3 보안 서비스 카드에서 지원됩니다.
다음 구성 작업을 수행합니다.
PCP 서버 옵션 구성
PCP 규칙 구성
PCP 규칙에는 모든 서비스 세트 규칙과 동일한 기본 옵션이 있습니다.
term
단일 규칙에 여러 응용 프로그램이 있을 수 있도록 허용하는 옵션입니다.차세대 서비스를 위해 MX-SPC3 보안 서비스 카드를 실행할 때는 기간이 필요하지 않습니다.
from
규칙의 적용을 받는 트래픽을 식별하는 옵션입니다.then
수행할 작업을 식별하는 옵션입니다. PCP 규칙의 경우, 이 옵션은 선택한 트래픽을 처리하는 pcp 서버를 식별합니다
NAT 규칙 구성
NAT 규칙을 구성하려면 다음을 수행합니다.
PCP 적용을 위한 서비스 세트 구성
PCP를 사용하려면 옵션에 규칙 이름(또는 규칙 이름 목록의 이름)을 pcp-rule rule-name
제공해야 합니다.
또한 서비스 세트는 필수 nat-rule
및 softwire-rule
.
SYSLOG 메시지 구성
PCP 로그 생성을 제어하기 위해 새로운 syslog 클래스인 구성 옵션 pcp-logs
이(가) 제공되었습니다. 다음과 같은 수준의 로깅을 제공합니다.
protocol
- 매핑 생성, 삭제와 관련된 모든 로그가 이 로깅 수준에 포함됩니다.protocol-error
—–모든 프로토콜 오류 관련 로그(예: 매핑 새로 고침 실패, PCP 조회 실패, 매핑 생성 실패). 이 로깅 수준에 포함됩니다.system-error
- 메모리 및 인프라 오류는 이 로깅 수준에 포함됩니다.
포트 제어 프로토콜 작업 모니터링
다음 작동 명령을 사용하여 PCP(Port Control Protocol) 작업을 모니터링할 수 있습니다.
MS-MPC의 경우 명령을 사용합니다
show services nat mappings pcp
.참고:PCP는 Junos OS 릴리스 19.3R2의 차세대 서비스에 대해 지원되지 않습니다.
MS-MPC의 경우 명령을 사용합니다
show services nat mappings endpoint-independent
.차세대 서비스의 경우 명령을 사용합니다
show services nat source mappings endpoint-independent
.show services pcp statistics protocol
다음은 이러한 명령의 출력 예입니다.
user@host> show services nat mappings pcp Interface: sp-0/0/0, Service set: in NAT pool: p PCP Client : 10.1.1.2 PCP lifetime : 995 Mapping : 10.1.1.2 : 9000 --> 8.8.8.8 : 1025 Session Count : 1 Mapping State : Active DS-LITE output: =============== PCP Client : 2222::1 PCP lifetime : 106 Mapping : 88.1.0.47 : 47 --> 70.70.70.1 :41972 Session Count : 1 Mapping State : Active B4 Address : 2222::1
user@host> show services nat mappings endpoint-independent Interface: sp-0/0/0, Service set: in NAT pool: p Mapping : 10.1.1.2 :57400 --> 8.8.8.8 : 1024 Session Count : 0 Mapping State : Timeout PCP Client : 10.1.1.2 PCP lifetime : 991 Mapping : 10.1.1.2 : 9000 --> 8.8.8.8 : 1025 Session Count : 1 Mapping State : Active DS-LITE output: =============== PCP Client : 2222::1 PCP lifetime : 190 Mapping : 88.1.1.3 : 4001 --> 70.70.70.2 :58989 Session Count : 1 Mapping State : Active B4 Address : 2222::1
user@host> show services pcp statistics protocol Protocol Statistics: Operational Statistics Map request received :0 Peer request received :0 Other operational counters :0 Option Statistics Unprocessed requests received :0 Third party requets received :0 Prefer fail option received :0 Filter option received :0 Other options counters :0 Option optional received :0 Result Statistics PCP success :0 PCP unsupported version :0 Not authorized :0 Bad requests :0 Unsupported opcode :0 Unsupported option :0 Bad option :0 Network failure :0 Out of resources :0 Unsupported protocol :0 User exceeded quota :0 Cannot provide external :0 Address mismatch :0 Excessive number of remote peers :0 Processing error :0 Other result counters :0
예: NAPT44를 사용한 포트 제어 프로토콜 구성
PCP는 MS-DPC, MS-100, MS-400 및 MS-500 MultiServices PICS에서 지원됩니다. Junos OS 릴리스 17.4R1부터 NATP44용 PCP는 MS-MPC 및 MS-MIC에서도 지원됩니다.
요구 사항
하드웨어 요구 사항
PCP 클라이언트가 있는 UE.
MS-DPC 서비스 PIC가 있는 MX 3D 라우터.
소프트웨어 요구 사항
Junos OS 13.2
Layer-3 서비스 패키지
개요
ISP는 PCP 클라이언트가 있는 UE가 시간 초과 없이 서버에 대한 연결을 유지할 수 있도록 하려고 합니다. PCP 클라이언트는 필요한 연결 유형 및 기간에 대한 PCP 요청을 생성합니다. 연결은 웹캠을 사용하는 애플리케이션과 같이 긴 기간일 수도 있고 온라인 게임과 같이 더 짧은 기간일 수도 있습니다. MX 3D 라우터는 PCP 클라이언트 요청을 해석하기 위한 PCP 서버와 NAPT44를 제공합니다. 그림 3 은 이 예의 기본 토폴로지를 보여줍니다.

PCP 구성
CLI 빠른 구성
이 예제를 빠르게 구성하려면 다음 명령을 복사하여 텍스트 파일에 붙여 넣은 다음 줄 바꿈을 제거하고, 네트워크 구성과 일치하는 데 필요한 세부 정보를 변경한 다음, 명령을 복사하여 [edit] 계층 수준에서 CLI에 붙여넣습니다.
set chassis fpc 2 pic 0 adaptive-services service-package layer-3 set interfaces sp-2/0/0 services-options inactivity-timeout 180 cgn-pic set interfaces sp-2/0/0 unit 0 family inet set interfaces xe-3/2/0 unit 0 family inet service input service-set sset_0 set interfaces xe-3/2/0 unit 0 family inet service output service-set sset_0 set interfaces xe-3/2/0 unit 0 family inet address 30.0.0.1/24 set interfaces xe-5/0/0 unit 0 family inet address 25.0.0.1/24 set services nat pool pcp-pool address 44.0.0.0/16 set services nat pool pcp-pool port automatic random-allocation address-allocation round-robin set services nat pool pcp-pool address-allocation round-robin set services nat rule pcp-rule match-direction input set services nat rule pcp-rule term t0 then translated source-pool pcp-pool translation-type napt-44 set services nat rule pcp-rule term t0 then translated mapping-type endpoint-independent filtering-type endpoint-independent set services nat rule pcp-rule term t0 then translated mapping-type endpoint-independent filtering-type endpoint-independent set services pcp server pcp-s1 ipv4-address 124.124.124.122 set services pcp server pcp-s1 mapping-lifetime-minimum 600 mapping-lifetime-maximum 86500 set services pcp server pcp-s1 short-lifetime-error 120 long-lifetime-error 1200 set services pcp server pcp-s1 max-mappings-per-client 128 pcp-options third-party prefer-failure set services service-set sset_0 pcp-rules r1 set services service-set sset_0 nat-rules pcp-rule set services service-set sset_0 interface-service service-interface sp-2/0/0.0
섀시 구성
단계별 절차
레이어 3 서비스 패키지를 사용하여 서비스 PIC(FPC 2 슬롯 0)를 구성하려면:
[edit chassis] 계층 수준으로 이동합니다.
user@host# edit chassis
레이어 3 서비스 패키지를 구성합니다.
[edit chassis]
user@host# set fpc 2 pic 0 adaptive-services service-package layer-3
결과
user@host# show chassis fpc 2 pic 0 pcp-rules pcp-napt44-rule; nat-rules pcp-rule; interface-service { service-interface sp-2/0/0.0; }
인터페이스 구성
단계별 절차
서비스 MS-DPC를 구성합니다.
user@host# set interfaces sp-2/0/0 services-options inactivity-timeout 180 cgn-pic user@host# set interfaces sp-2/0/0 unit 0 family inet
네트워크 주소 변환(NAT) 및 PCP 서비스에 사용되는 고객 대면 인터페이스를 구성합니다.
user@host# set interfaces xe-3/2/0 unit 0 family inet service input service-set sset_0 user@host# set interfaces xe-3/2/0 unit 0 family inet service output service-set sset_0 user@host# set interfaces xe-3/2/0 unit 0 family inet address 30.0.0.1/24
인터넷 연결 인터페이스를 구성합니다.
user@host# set interfaces xe-5/0/0 unit 0 family inet address 25.0.0.1/24
결과
user@host# sp-2/0/0 { services-options { inactivity-timeout 180; cgn-pic; } unit 0 { family inet; } } xe-3/2/0 { unit 0 { family inet { service { input { service-set sset_0; } output { service-set sset_0; } } address 30.0.0.1/24; } } } xe-5/0/0 { unit 0 { family inet { address 25.0.0.1/24; } } }
NAT 컨피그레이션
단계별 절차
계층 구조로
[edit services nat]
이동합니다.user@host# edit services nat
라는
pcp-pool
NAT 풀을 구성합니다.[edit services nat]
user@host# set pool pcp-pool address 44.0.0.0/16 user@host# set pool pcp-pool port automatic random-allocation user@host# set pool pcp-pool address-allocation round-robin라는
pcp-rule
NAT 규칙을 구성합니다.[edit services nat]
user@host# set rule pcp-rule term t0 then translated source-pool pcp-pool translation-type napt-44 user@host# set rule pcp-rule term t0 then translated mapping-type endpoint-independent filtering-type endpoint-independent
결과
user@host# show services nat pool pcp-pool { address 44.0.0.0/16; port { automatic { random-allocation; } } address-allocation round-robin; } rule pcp-rule { match-direction input; term t0 { then { translated { source-pool pcp-pool; translation-type { napt-44; } mapping-type endpoint-independent; filtering-type { endpoint-independent; } } } } }
PCP 구성
단계별 절차
PCP 서버 및 PCP 규칙 옵션을 구성합니다.
edit services pcp
서버의 계층 수준으로 이동합니다pcp-s1
user@host# edit services pcp server pcp-s1
PCP 서버 옵션을 구성합니다.
[edit services pcp server pcp-s1] user@host# set ipv4-address 124.124.124.122 user@host# set mapping-lifetime-minimum 600 user@host# set mapping-lifetime-maximum 86500 user@host# set short-lifetime-error 120 user@host# set long-lifetime-error 1200 user@host# set max-mappings-per-client 128 user@host# set pcp-options third-party prefer-failure
PCP 규칙을 만듭니다.
[edit services pcp rule pcp-napt44-rule user@host# edit rule pcp-napt44-rule
PCP 규칙 옵션을 구성합니다.
[edit services pcp rule pcp-napt44-rule] user@host# set match-direction input user@host# set term t0 then pcp-server pcp-s1
결과
user@host# show services pcp server pcp-s1 { ipv4-address 124.124.124.122; mapping-lifetime-minimum 600; mapping-lifetime-maximum 86500; short-lifetime-error 120; long-lifetime-error 1200; max-mappings-per-client 128; pcp-options third-party prefer-failure; } rule pcp-napt44-rule { match-direction input; term t0 { then { pcp-server pcp-s1; } } }
서비스 세트 구성
단계별 절차
계층 수준에서 서비스 세트
sset_0
을(를)edit services service-set
생성합니다.user@host# edit services service-set sset_0
service-set sset_0 { pcp-rules pcp-napt44-rule; nat-rules pcp-rule; interface-service { service-interface sp-2/0/0.0; } }
서비스 세트와 연결된 NAT 규칙을 식별합니다.
[edit services service-set sset_0] user@host# set nat-rules pcp-rule
서비스 세트와 연결된 PCP 규칙을 식별합니다.
[edit services service-set sset_0] user@host# set pcp-rules r1
서비스 세트와 연관된 서비스 인터페이스를 식별합니다.
[edit services service-set sset_0] user@host# set interface-service service-interface sp-2/0/0.0
결과
user@host# show pcp-rules pcp-napt44-rule; nat-rules pcp-rule; interface-service { service-interface sp-2/0/0.0; }
변경 내역 테이블
기능 지원은 사용 중인 플랫폼 및 릴리스에 따라 결정됩니다. 기능 탐색기 를 사용하여 플랫폼에서 기능이 지원되는지 확인합니다.