PCP WG                                                      M. Boucadair
Internet-Draft                                            France Telecom
Intended status: Informational                            March 23, 2015
Expires: September 24, 2015


               Port Control Protocol (PCP) Flow Examples
                  draft-boucadair-pcp-flow-examples-04

Abstract

   This document provides a set of examples to illustrate Port Control
   Protocol (PCP) operations.  It is a companion document to the base
   PCP specification.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 24, 2015.

Copyright Notice

   Copyright (c) 2015 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.





Boucadair              Expires September 24, 2015               [Page 1]


Internet-Draft              PCP Flow Examples                 March 2015


Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Basic MAP Operations  . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Suggested External Port Honored by the PCP Server . . . .   3
     2.2.  IPv6-enabled PCP Client . . . . . . . . . . . . . . . . .   4
     2.3.  Remove an Existing Mapping  . . . . . . . . . . . . . . .   5
     2.4.  Suggested External Port Not Honored by the PCP Server . .   6
     2.5.  Suggested External IP Address . . . . . . . . . . . . . .   7
     2.6.  Create Mapping with Distinct External IP Addresses  . . .   8
     2.7.  Mapping Nonce Doesn't Match: Base PCP Specification . . .  11
     2.8.  Mapping Nonce Doesn't Match: Updated Specification  . . .  11
     2.9.  PREFER_FAILURE Option: Requested Port is Honored  . . . .  12
     2.10. PREFER_FAILURE Option: Requested Port is not Honored  . .  13
     2.11. Negative Impact of PREFER_FAILURE Option  . . . . . . . .  14
     2.12. Existing Implicit Mapping . . . . . . . . . . . . . . . .  15
     2.13. Shortening a Mapping Lifetime in the Presence of Client-
           Originated Traffic  . . . . . . . . . . . . . . . . . . .  17
     2.14. Create a Mapping for All Incoming Traffic of a Given
           Protocol  . . . . . . . . . . . . . . . . . . . . . . . .  17
     2.15. Create a Mapping for All Protocols  . . . . . . . . . . .  18
     2.16. Malformed Request . . . . . . . . . . . . . . . . . . . .  18
     2.17. Exceeded Port Quota . . . . . . . . . . . . . . . . . . .  19
     2.18. Unsupported Address Family  . . . . . . . . . . . . . . .  20
     2.19. Unsupported Protocol  . . . . . . . . . . . . . . . . . .  20
     2.20. Unsolicited MAP Response  . . . . . . . . . . . . . . . .  21
     2.21. Mapping Repair  . . . . . . . . . . . . . . . . . . . . .  22
   3.  NAT Detect Example  . . . . . . . . . . . . . . . . . . . . .  23
   4.  Retrieve the External IP Address  . . . . . . . . . . . . . .  24
   5.  THIRD_PARTY Examples  . . . . . . . . . . . . . . . . . . . .  25
     5.1.  THIRD_PARTY Enabled at the Server Side  . . . . . . . . .  25
     5.2.  THIRD_PARTY Disabled at the Server Side . . . . . . . . .  26
     5.3.  Malformed Request . . . . . . . . . . . . . . . . . . . .  26
   6.  MAP with FILTER Examples  . . . . . . . . . . . . . . . . . .  27
     6.1.  Basic Filter Usage  . . . . . . . . . . . . . . . . . . .  27
     6.2.  Remove All Filters  . . . . . . . . . . . . . . . . . . .  28
     6.3.  Change an Existing Filter . . . . . . . . . . . . . . . .  29
   7.  Assess the Reachability of the PCP Server . . . . . . . . . .  30
   8.  PEER Operations . . . . . . . . . . . . . . . . . . . . . . .  31
     8.1.  No Mapping Exists for the Internal Port Number  . . . . .  31
     8.2.  A Mapping Exists for the External Port Number . . . . . .  32
     8.3.  External IP Address Cannot be Honored . . . . . . . . . .  33
     8.4.  Extend the Lifetime . . . . . . . . . . . . . . . . . . .  34
     8.5.  Learn the Lifetime of a Mapping . . . . . . . . . . . . .  35
   9.  Version Negotiation . . . . . . . . . . . . . . . . . . . . .  36
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  37
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  37
   12. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  37



Boucadair              Expires September 24, 2015               [Page 2]


Internet-Draft              PCP Flow Examples                 March 2015


   13. References  . . . . . . . . . . . . . . . . . . . . . . . . .  37
     13.1.  Normative References . . . . . . . . . . . . . . . . . .  37
     13.2.  Informative References . . . . . . . . . . . . . . . . .  37
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  37

1.  Introduction

   As a companion document to [RFC6887], this document provides examples
   to help understanding the PCP machinery and exchanged PCP messages in
   various usage contexts.

   For more details about PCP protocol specification, the reader is
   invited to refer to [RFC6887].

   Examples included in this document make use of the IPv4 and IPv6
   address blocks for documentation purposes defined in [RFC5737] and
   [RFC3849].

2.  Basic MAP Operations

   The following figure illustrates the messages which are exchanged to
   create a mapping in a PCP-controlled device with MAP opcode.

   +------+                           +------+
   | PCP  |                           | PCP  |
   |Client|                           |Server|
   +------+                           +------+
       |      (1) PCP MAP Request         |
       |--------------------------------->|
       |      (2) PCP MAP Response        |
       |<---------------------------------|
       |                                  |


                  Figure 1: Example of creating a mapping

   The following sub-sections provide several examples depending on the
   content of the MAP request and the decision of the PCP server.

2.1.  Suggested External Port Honored by the PCP Server

   This example illustrates the content of exchanged PCP messages when
   the PCP client does not include any PCP Option in its request.  In
   this example, the PCP server assigns the suggested port number.  In
   reference to Figure 1, the content of exchanged PCP messages is as
   follows:





Boucadair              Expires September 24, 2015               [Page 3]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0

     Figure 2: MAP request (suggested External Port Honored by the PCP
                                  Server)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1

    Figure 3: MAP response (suggested External Port Honored by the PCP
                                  Server)

2.2.  IPv6-enabled PCP Client

   This example illustrates the content of exchanged PCP messages when
   the PCP client is assigned with an IPv6 address but the remote server
   controls a NAT44 device.  In reference to Figure 1, the content of
   exchanged PCP messages is as follows:














Boucadair              Expires September 24, 2015               [Page 4]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: 2001:db8:0:0:1::1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0

     Figure 4: MAP request (suggested External Port Honored by the PCP
                                  Server)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1

    Figure 5: MAP response (suggested External Port Honored by the PCP
                                  Server)

2.3.  Remove an Existing Mapping

   This example illustrates the content of exchanged PCP messages when
   the PCP client request the removal of an existing mapping.
















Boucadair              Expires September 24, 2015               [Page 5]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 0 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1

            Figure 6: MAP request (Remove an Existing Mapping)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 0 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1

            Figure 7: MAP response (Remove an Existing Mapping)

2.4.  Suggested External Port Not Honored by the PCP Server

   This example illustrates the content of exchanged PCP messages when
   the PCP client does not include any PCP Option in its request.  In
   this example, the PCP server does not assign the suggested external
   port number.  In reference to Figure 1, the content of exchanged PCP
   messages is as follows:















Boucadair              Expires September 24, 2015               [Page 6]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 11000
    Suggested External Port: 11000
    Suggested External IP Address: ::ffff:0.0.0.0

   Figure 8: MAP request (Suggested External Port Not Honored by the PCP
                                  Server)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 11000
    Assigned External Port: 15200
    Assigned External IP Address: ::ffff:192.0.2.1

    Figure 9: MAP response (Suggested External Port Not Honored by the
                                PCP Server)

2.5.  Suggested External IP Address

   This example illustrates the content of exchanged PCP messages when
   the PCP client does not include any PCP Option in its request.  In
   this example, the PCP client indicates a hinted external IP address
   honored by the PCP server.  In reference to Figure 1, the content of
   exchanged PCP messages is as follows:













Boucadair              Expires September 24, 2015               [Page 7]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:192.0.2.1

          Figure 10: MAP request (Suggested External IP Address)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 15200
    Assigned External IP Address: ::ffff:192.0.2.1

          Figure 11: MAP response (Suggested External IP Address)

2.6.  Create Mapping with Distinct External IP Addresses

   Figure 12 shows a PCP server with a pool of public IPv4 addresses
   (192.0.2/24) and two PCP clients associated with different
   subscribers.  The PCP clients each make a port mapping request to the
   PCP server which creates the mapping from its 192.0.2/24 pool.
















Boucadair              Expires September 24, 2015               [Page 8]


Internet-Draft              PCP Flow Examples                 March 2015


   +--------+                     +------+                   +--------+
   |  PCP   |                     | PCP  |                   |  PCP   |
   |Client 1|                     |Server|                   |Client 2|
   +--------+                     +------+                   +--------+
       |    (1) PCP MAP Request      |                            |
       |---------------------------->|                            |
       |    (2) PCP MAP Response     |                            |
       |<----------------------------|   (a) PCP MAP Request      |
       |                             |<---------------------------|
       |                             |   (b) PCP MAP Response     |
       |                             |--------------------------->|
       |                             |                            |


     Figure 12: Example of creating mappings with distinct external IP
                                 addresses

   In this example, the PCP clients were mapped to different public
   addresses as illustrated in the content of the PCP messages listed
   below.

   The content of PCP messages exchanged between PCP client 1 and the
   PCP server is as follows:

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 15333
    Suggested External Port: 15333
    Suggested External IP Address: ::ffff:0.0.0.0

                   Figure 13: MAP request (PCP Client 1)














Boucadair              Expires September 24, 2015               [Page 9]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 15333
    Assigned External Port: 12000
    Assigned External IP Address: ::ffff:192.0.2.1

                  Figure 14: MAP response (PCP Client 1)

   The content of PCP messages exchanged between PCP client 2 and the
   PCP server is as follows:

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.2
   MAP Request:
    Mapping Nonce: 59869
    Protocol: UDP (17)
    Internal Port: 12000
    Suggested External Port: 12000
    Suggested External IP Address: ::ffff:0.0.0.0

                   Figure 15: MAP request (PCP Client 2)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 59869
    Protocol: UDP (17)
    Internal Port: 12000
    Assigned External Port: 6000
    Assigned External IP Address: ::ffff:192.0.2.2

                  Figure 16: MAP response (PCP Client 2)





Boucadair              Expires September 24, 2015              [Page 10]


Internet-Draft              PCP Flow Examples                 March 2015


2.7.  Mapping Nonce Doesn't Match: Base PCP Specification

   CAUTION: The behavior described in this section is obsoleted by
   [I-D.cheshire-pcp-unsupp-family].  This section records the behavior
   as initially specified the base PCP specification [RFC6887].

   This example illustrates the content of exchanged PCP messages when
   the PCP client does not include any PCP Option in its request.  In
   this example, the PCP client indicates a distinct Mapping Nonce than
   the one stored by the PCP server.  In reference to Figure 1, the
   content of exchanged PCP messages is as follows:

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 45687
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:192.0.2.1

           Figure 17: MAP request (Mapping Nonce Doesn't Match)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: NOT_AUTHORIZED (0x02)
   Lifetime: 35550 sec
   Epoch Time: 1300

           Figure 18: MAP response (Mapping Nonce Doesn't Match)

2.8.  Mapping Nonce Doesn't Match: Updated Specification

   Nonce validation checks are problematic in various scenarios as
   discussed in [I-D.cheshire-pcp-unsupp-family].  As a consequence, the
   nonce validation checks are relaxed as follows: If operating in the
   Simple Threat Model (Section 18.1 of the PCP specification
   [RFC6887]), and the internal port, protocol, internal address, and
   external address family match an existing explicit dynamic mapping,
   but the mapping nonce does not match, then the existing mapping is
   not modified in any way, and a valid PCP reply is returned to the
   client, using the client-specified nonce, reporting the external
   address, port, and remaining lifetime of the existing mapping.  An
   example is shown in Figure 19 andFigure 3.



Boucadair              Expires September 24, 2015              [Page 11]


Internet-Draft              PCP Flow Examples                 March 2015


   The request shown in Figure 19 matches an existing mapping (see
   Figure 3).  Even if the nonce of the exiting mapping does not match
   the one indicated in the request, a positive answer is returned to
   the requesting PCP client without any change to the existing mapping.
   The nonce of the existing mapping (i.e., 15685) is not returned in
   the response.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 45687
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:192.0.2.1

                          Figure 19: MAP request

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 10000 sec
   Epoch Time: 3500
   MAP Response:
    Mapping Nonce: 45687
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1

                          Figure 20: MAP response

2.9.  PREFER_FAILURE Option: Requested Port is Honored

   This flow shows an example of the content of PCP messages that will
   be exchanged to create a mapping in a PCP-controlled device.  In this
   example, the PCP client indicates a requested external UDP port
   number and also a PREFER_FAILURE Option.  In this example, we suppose
   the requested port can be honored by the PCP server.  In reference to
   Figure 1, the content of exchanged PCP messages is as follows:







Boucadair              Expires September 24, 2015              [Page 12]


Internet-Draft              PCP Flow Examples                 March 2015


  Version: 2
  R bit: Request (0)
  opcode: MAP (0x01)
  Requested Lifetime: 36000 sec
  PCP client's IP Address: ::ffff:198.51.100.1
  MAP Request:
   Mapping Nonce: 15685
   Protocol: UDP (17)
   Internal Port: 1234
   Suggested External Port: 12536
   Suggested External IP Address: ::ffff:0.0.0.0
  Option Code: PREFER_FAILURE (0x02) Option Length: 0 bytes Data: (NULL)

     Figure 21: MAP request ( PREFER_FAILURE Option: Requested Port is
                                 Honored)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 36000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 1234
    Assigned External Port: 12536
    Assigned External IP Address: ::ffff:192.0.2.1

    Figure 22: MAP response ( PREFER_FAILURE Option: Requested Port is
                                 Honored)

2.10.  PREFER_FAILURE Option: Requested Port is not Honored

   This flow shows an example of the content of PCP messages that will
   be exchanged to create a mapping in a PCP-controlled device.  In this
   example, the PCP client indicates a requested external UDP port
   number and also a PREFER_FAILURE Option.  In this example, we suppose
   the requested port cannot be honored by the PCP server.  In reference
   to Figure 1, the content of exchanged PCP messages is as follows:











Boucadair              Expires September 24, 2015              [Page 13]


Internet-Draft              PCP Flow Examples                 March 2015


  Version: 2
  R bit: Request (0)
  opcode: MAP (0x01)
  Requested Lifetime: 36000 sec
  PCP client's IP Address: ::ffff:198.51.100.1
  MAP Request:
   Mapping Nonce: 15685
   Protocol: UDP (17)
   Internal Port: 1234
   Suggested External Port: 1234
   Suggested External IP Address: ::ffff:0.0.0.0
  Option Code: PREFER_FAILURE (0x02) Option Length: 0 bytes Data: (NULL)

   Figure 23: MAP request (PREFER_FAILURE Option: Requested Port is not
                                 Honored)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: CANNOT_PROVIDE_EXTERNAL (0x11)
   Lifetime: 1560 sec
   Epoch Time: 1300

   Figure 24: MAP response (PREFER_FAILURE Option: Requested Port is not
                                 Honored)

2.11.  Negative Impact of PREFER_FAILURE Option

   The presence of PREFER_FAILURE option in a request may have negative
   impact on an application which does not require it.  Figure 25 shows
   two examples:

   1.  With PREFER_FAILURE option: several round trips are needed for
       the client to retrieve the requested mapping.
   2.  Without PREFER_FAILURE option: the client retrieves a mapping
       without any extra delay.















Boucadair              Expires September 24, 2015              [Page 14]


Internet-Draft              PCP Flow Examples                 March 2015


       (1) PREFER_FAILURE Option        (2) No PREFER_FAILURE Option

   +------+                  +------+ +------+                  +------+
   | PCP  |                  |  PCP | | PCP  |                  |  PCP |
   |Client|                  |Server| |Client|                  |Server|
   +------+                  +------+ +------+                  +------+
    |       PCP MAP Request      |      |       PCP MAP Request      |
    |Suggested External Port=8080|      |Suggested External Port=8080|
    |       PREFER_FAILURE       |      |--------------------------->|
    |--------------------------->|      |                            |
    |      PCP MAP Response      |      |       PCP MAP Response     |
    |   CANNOT_PROVIDE_EXTERNAL  |      |Assigned External Port=6598 |
    |<---------------------------|      |<---------------------------|
    |                            |      |          TCP SYN           |
    |       PCP MAP Request      |      |--------------------------->|
    |Suggested External Port=5485|
    |       PREFER_FAILURE       |
    |--------------------------->|
    |      PCP MAP Response      |
    |   CANNOT_PROVIDE_EXTERNAL  |
    |<---------------------------|
                   ....
    |       PCP MAP Request      |
    |Suggested External Port=6591|
    |       PREFER_FAILURE       |
    |--------------------------->|
    |      PCP MAP Response      |
    |   CANNOT_PROVIDE_EXTERNAL  |
    |<---------------------------|


   Figure 25: Negative Impact of the mis-usage of PREFER_FAILURE option

2.12.  Existing Implicit Mapping

   This example illustrates the content of exchanged PCP messages when
   the PCP client requests a mapping which matches an existing implicit
   dynamic mapping (see Figure 26).  In this example, the PCP-Controlled
   device assigns 10000 as external port number when translating the
   packet from the client having with source port set to 1234.

   This behavior is specified in Section 11.3 of [RFC6887].









Boucadair              Expires September 24, 2015              [Page 15]


Internet-Draft              PCP Flow Examples                 March 2015


   +------+                           +------+
   | PCP  |                           | PCP  |
   |Client|                           |Server|
   +------+                           +------+
       |      (a) TCP SYN(src:1234)       |
       |--------------------------------->|
       |      (1) PCP MAP Request         |
       |--------------------------------->|
       |      (2) PCP MAP Response        |
       |<---------------------------------|
       |                                  |


                 Figure 26: Example of creating a mapping

   In reference to Figure 1, the content of exchanged PCP messages is as
   follows:

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: TCP (0x06)
    Internal Port: 1234
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0

            Figure 27: MAP request (Existing Implicit Mapping)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: TCP (0x06)
    Internal Port: 1234
    Assigned External Port: 10000
    Assigned External IP Address: ::ffff:192.0.2.1

            Figure 28: MAP response (Existing Implicit Mapping)





Boucadair              Expires September 24, 2015              [Page 16]


Internet-Draft              PCP Flow Examples                 March 2015


2.13.  Shortening a Mapping Lifetime in the Presence of Client-
       Originated Traffic

   Figure 29 shows an example illustrating the impact of requesting the
   deletion of a mapping in the presence of traffic originated from the
   client.  In this example, the PCP server does not remove the
   requested mapping immediately; the returned lifetime is set to the
   remaining lifetime.

   This behavior is specified in Section 15 of [RFC6887].

   +------+                  +---------------------+
   | PCP  |                  |    PCP server       |
   |Client|                  |PCP-Controlled Device|
   +------+                  +---------------------+
       |                                  |
       |=========Traffic==================|===========>
       |   PCP MAP Request (Lifetime=0)   |
       |--------------------------------->|
       |  PCP MAP Response (Lifetime=     |
       |          remaining idle-timeout) |
       |<---------------------------------|
       |<========Traffic==================|<==========
       |                                  |


    Figure 29: Shortening a Mapping Lifetime in the Presence of Client-
                            Originated Traffic

2.14.  Create a Mapping for All Incoming Traffic of a Given Protocol

   This example illustrates the content of the PCP MAP request to create
   a mapping for all incoming traffic of a given protocol (UDP is used
   in this example).

















Boucadair              Expires September 24, 2015              [Page 17]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 0
    Suggested External Port: 0
    Suggested External IP Address: ::ffff:0.0.0.0

   Figure 30: MAP request (Create a mapping for all incoming traffic of
                             a given protocol)

   The PCP server may honor the request or reject it by sending
   UNSUPP_PROTOCOL (0x09) error.

2.15.  Create a Mapping for All Protocols

   This example illustrates the content of the PCP MAP request to create
   a mapping for the traffic of all protocols.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: ANY (0)
    Internal Port: 0
    Suggested External Port: 0
    Suggested External IP Address: ::ffff:0.0.0.0

        Figure 31: MAP request (Create a mapping for all protocols)

   The PCP server may honor the request or reject it by sending
   UNSUPP_PROTOCOL (0x09) error.

2.16.  Malformed Request

   This flow shows an example of the content of PCP messages that will
   be exchanged when a malformed request is received by the PCP server.
   In this example, the Protocol field is set to null.






Boucadair              Expires September 24, 2015              [Page 18]


Internet-Draft              PCP Flow Examples                 March 2015


  Version: 2
  R bit: Request (0)
  opcode: MAP (0x01)
  Requested Lifetime: 36000 sec
  PCP client's IP Address: ::ffff:198.51.100.1
  MAP Request:
   Mapping Nonce: 45698
   Protocol: ANY (0)
   Internal Port: 5698
   Suggested External Port: 3938
   Suggested External IP Address: ::ffff:0.0.0.0
  Option Code: PREFER_FAILURE (0x02) Option Length: 0 bytes Data: (NULL)

                Figure 32: MAP request (Malformed Request)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: MALFORMED_REQUEST (0x02)
   Lifetime: 0 sec
   Epoch Time: 1300

                Figure 33: MAP response (Malformed Request)

2.17.  Exceeded Port Quota

   This flow shows an example of the content of PCP messages that will
   be exchanged when a per-user quota is reached.  A short lifetime is
   returned so that the client may retry and see if the request can be
   honored because another state has been removed.

  Version: 2
  R bit: Request (0)
  opcode: MAP (0x01)
  Requested Lifetime: 36000 sec
  PCP client's IP Address: ::ffff:198.51.100.1
  MAP Request:
   Mapping Nonce: 45698
   Protocol: UDP (17)
   Internal Port: 8695
   Suggested External Port: 3938
   Suggested External IP Address: ::ffff:0.0.0.0
  Option Code: PREFER_FAILURE (0x02) Option Length: 0 bytes Data: (NULL)

               Figure 34: MAP request (Exceeded Port Quota)






Boucadair              Expires September 24, 2015              [Page 19]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: USER_EX_QUOTA (10)
   Lifetime: 300 sec
   Epoch Time: 1300

               Figure 35: MAP response (Exceeded Port Quota)

2.18.  Unsupported Address Family

   This flow shows an example of the content of PCP messages that will
   be exchanged when the requested external address family is not
   supported by the PCP server.  In this example, IPv6 is indicated as
   the requested AF.  The PCP server answers with an UNSUPP_FAMILY (14)
   error as defined in [I-D.cheshire-pcp-unsupp-family].

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 45698
    Protocol: UDP (17)
    Internal Port: 8695
    Suggested External Port: 3938
    Suggested External IP Address: ::

            Figure 36: MAP request (Unsupported Address Family)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: UNSUPP_FAMILY (14)
   Lifetime: 0 sec
   Epoch Time: 1300

           Figure 37: MAP response (Unsupported Address Family)

2.19.  Unsupported Protocol

   This flow shows an example of the content of PCP messages that will
   be exchanged when the requested port is not supported by the PCP
   server.  In this example, SCTP is indicated as the requested
   protocol.





Boucadair              Expires September 24, 2015              [Page 20]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 45698
    Protocol: SCTP (132)
    Internal Port: 8695
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0

               Figure 38: MAP request (Unsupported Protocol)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: UNSUPP_PROTOCOL (9)
   Lifetime: 0 sec
   Epoch Time: 1300

              Figure 39: MAP response (Unsupported Protocol)

2.20.  Unsolicited MAP Response

   Suppose the client has instructed a UDP mapping for port 3938
   (assigned external port is 15000 and assigned external IPv4 address
   is: 192.0.2.1).  Upon a change of a state: e.g., change of the
   external IP Address, the PCP server issues an unsolicited MAP
   response.  The content of the MAP response sent by the PCP server is
   shown below.  The PCP client is now aware of the new assigned
   external IP address.

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: TCP (0x06)
    Internal Port: 1234
    Assigned External Port: 10000
    Assigned External IP Address: ::ffff:192.0.2.2

                    Figure 40: Unsolicited MAP Response




Boucadair              Expires September 24, 2015              [Page 21]


Internet-Draft              PCP Flow Examples                 March 2015


2.21.  Mapping Repair

   An example of mapping repair is shown in Figure 41.

   +------+                      +------+
   | PCP  |                      | PCP  |
   |Client|                      |Server|
   +------+                      +------+
       |     (1) PCP ANNOUNCE        |
       |<----------------------------|
       |     (2) PCP MAP REQUEST     |
       |---------------------------->|
       |     (3) PCP MAP RESPONSE    |
       |<----------------------------|
       |                             |


        Figure 41: Flow Example of a PING/PONG exchange: Check the
                      availability of the PCP Server

   Version: 2
   R bit: Response (1)
   opcode: ANNOUNCE (0x00)
   Result Code: 0
   Lifetime: 0 sec
   Epoch Time: 0

                      Figure 42: Unsolicited ANNOUNCE

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 11000
    Assigned External Port: 15200
    Assigned External IP Address: ::ffff:192.0.2.1

                  Figure 43: MAP request (Mapping Repair)









Boucadair              Expires September 24, 2015              [Page 22]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 10
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 11000
    Assigned External Port: 15200
    Assigned External IP Address: ::ffff:192.0.2.1

                 Figure 44: MAP response (Mapping Repair)

3.  NAT Detect Example

   Let us suppose a PCP-unaware NAT is located between the PCP server
   and the PCP client.  An example of PCP MAP request issued by the PCP
   client is shown below.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 11000
    Assigned External Port: 15200
    Assigned External IP Address: ::ffff:0.0.0.0

                    Figure 45: MAP request (NAT Detect)

   This message will be translated by the PCP-unaware NAT.  The source
   IP address if the resulting message will be another address than
   198.51.100.1.  Upon receipt of this message, the PCP server compares
   the source IP address and the content of PCP client's IP Address
   field.  Because the two addresses are not equal, the PCP server
   concludes there is PCP-unaware device in the path.  As a result, the
   PCP server will issue the following error message:









Boucadair              Expires September 24, 2015              [Page 23]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: ADDRESS_MISMATCH (12)
   Lifetime: 0 sec
   Epoch Time: 36000

                   Figure 46: MAP Response (NAT Detect)

   This behavior is specified in Section 8.2 of [RFC6887].

4.  Retrieve the External IP Address

   In order to retrieve the IP address used on the external side of the
   PCP-controlled device, the PCP client sends a short-lived mapping
   (e.g., Discard service (TCP/9 or UDP/9) or other port).  The returned
   IP address can be displayed by any application requiring such
   information.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 5 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 9
    Suggested External Port: 9
    Suggested External IP Address: ::ffff:0.0.0.0

         Figure 47: MAP request (Retrieve the External IP Address)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 60 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 9
    Suggested External Port: 9
    Assigned External IP Address: ::ffff:192.0.2.1

        Figure 48: MAP Response (Retrieve the External IP Address)




Boucadair              Expires September 24, 2015              [Page 24]


Internet-Draft              PCP Flow Examples                 March 2015


   This behavior is specified in Section 11.6 of [RFC6887].

5.  THIRD_PARTY Examples

   These examples follow the behavior specified in Section 13.1 of
   [RFC6887].

5.1.  THIRD_PARTY Enabled at the Server Side

   The following messages are exchanged when the THIRD_PARTY option is
   enabled in the PCP server side.  In this example the PCP client
   creates a mapping for the host assigned with 198.51.100.2.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 16584
    Protocol: UDP (17)
    Internal Port: 8080
    Suggested External Port: 8080
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: THIRD_PARTY (0x01) Option Length: 16 bytes Data:
               ::ffff:198.51.100.2

                  Figure 49: MAP request with THIRD_PARTY

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 16584
    Protocol: UDP (17)
    Internal Port: 8080
    Assigned External Port: 15000
    Assigned External IP Address: ::ffff:161.105.194.14
   Option Code: THIRD_PARTY (0x01) Option Length: 16 bytes Data:
               ::ffff:198.51.100.2

                 Figure 50: MAP Response with THIRD_PARTY






Boucadair              Expires September 24, 2015              [Page 25]


Internet-Draft              PCP Flow Examples                 March 2015


5.2.  THIRD_PARTY Disabled at the Server Side

   The following messages are exchanged when the THIRD_PARTY option is
   disabled in the PCP server side.  In this example the PCP client
   tries to create a mapping for the host assigned with 198.51.100.2.

   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 16584
    Protocol: UDP (17)
    Internal Port: 8080
    Suggested External Port: 8080
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: THIRD_PARTY (0x01) Option Length: 16 bytes Data:
               ::ffff:198.51.100.2

                  Figure 51: MAP request with THIRD_PARTY

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: UNSUPP_OPTION (0x05)
   Lifetime: 0 sec
   Epoch Time: 1562

                 Figure 52: MAP Response with THIRD_PARTY

5.3.  Malformed Request

   In this example the PCP client inserts a THIRD_PARTY option which
   include the IP address of the PCP client.
















Boucadair              Expires September 24, 2015              [Page 26]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 16584
    Protocol: UDP (17)
    Internal Port: 8080
    Suggested External Port: 8080
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: THIRD_PARTY (0x01) Option Length: 16 bytes Data:
               ::ffff:198.51.100.1

                  Figure 53: MAP request with THIRD_PARTY

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: MALFORMED_REQUEST (0x03)
   Lifetime: 0 sec
   Epoch Time: 1562

                 Figure 54: MAP Response with THIRD_PARTY

6.  MAP with FILTER Examples

   These examples follow the behavior specified in Section 13.3 of
   [RFC6887].

6.1.  Basic Filter Usage

   This example illustrates the content of exchanged PCP messages when
   the PCP client wants to receive traffic only from 192.0.2.200:5968.
   In reference to Figure 1, the content of exchanged PCP messages is as
   follows:















Boucadair              Expires September 24, 2015              [Page 27]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 128
               Remote Peer Port: 5968
               Remote Peer IP Address: ::ffff:192.0.2.200

                Figure 55: MAP request (Basic Filter Usage)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 128
               Remote Peer Port: 5968
               Remote Peer IP Address: ::ffff:192.0.2.200

               Figure 56: MAP Response (Basic Filter Usage)

6.2.  Remove All Filters

   This example illustrates the content of exchanged PCP messages when
   the PCP client wants to remove all filters.  In reference to
   Figure 1, the content of exchanged PCP messages is as follows:









Boucadair              Expires September 24, 2015              [Page 28]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 0
               Remote Peer Port: 0
               Remote Peer IP Address: ::ffff:0:0

                Figure 57: MAP request (Remove All Filters)

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   MAP Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 0
               Remote Peer Port: 0
               Remote Peer IP Address: ::ffff:0:0

               Figure 58: MAP response (Remove All Filters)

6.3.  Change an Existing Filter

   This example illustrates the content of exchanged PCP messages when
   the PCP client wants to change an existing filter.  In reference to
   Figure 1, the content of exchanged PCP messages is as follows:









Boucadair              Expires September 24, 2015              [Page 29]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 0
               Remote Peer Port: 0
               Remote Peer IP Address: ::ffff:0:0
   Option Code: FILTER (0x03) Option Length: 20 bytes Data:
               Prefix Length: 128
               Remote Peer Port: 5968
               Remote Peer IP Address: ::ffff:192.0.2.201

            Figure 59: MAP request (Change an Existing Filter)

7.  Assess the Reachability of the PCP Server

   In this example, the PCP client issues a PCP ANNOUNCE request to a
   PCP server.  Once received by the PCP server, since it is configured
   to reply to such request, it sends back a PCP ANNOUNCE response.
   This procedure can be used to retrieve the Epoch time.

   +------+                      +------+
   | PCP  |                      | PCP  |
   |Client|                      |Server|
   +------+                      +------+
       |   (1) PCP ANNOUNCE REQUEST  |
       |---------------------------->|
       |   (2) PCP ANNOUNCE RESPONSE |
       |<----------------------------|
       |                             |


        Figure 60: Flow example of a PING/PONG exchange: Check the
                      availability of the PCP server









Boucadair              Expires September 24, 2015              [Page 30]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: ANNOUNCE (0x00)
   Requested Lifetime: 0 sec
   PCP client's IP Address: ::ffff:198.51.100.1

      Figure 61: ANNOUNCE request (Assess the Reachability of the PCP
                                  Server)

   Version: 2
   R bit: Response (1)
   opcode: ANNOUNCE (0x00)
   Result Code: 0
   Lifetime: 0 sec
   Epoch Time: 3600

     Figure 62: ANNOUNCE response (Assess the Reachability of the PCP
                                  Server)

8.  PEER Operations

   The following figure illustrates the messages which are exchanged
   when PEER opcode is used:

   +------+                           +------+
   | PCP  |                           | PCP  |
   |Client|                           |Server|
   +------+                           +------+
       |      (1) PCP PEER Request        |
       |--------------------------------->|
       |      (2) PCP PEER Response       |
       |<---------------------------------|
       |                                  |


                 Figure 63: Typical usage of PEER message

   Examples listed below follow the behavior specified in Section 12.2
   and Section 12.3 of [RFC6887].

8.1.  No Mapping Exists for the Internal Port Number

   In reference to Figure 63, the content of exchanged PEER messages
   when no mapping is maintained by the PCP server for the indicated
   external port number:






Boucadair              Expires September 24, 2015              [Page 31]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: PEER (0x02)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   PEER Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

     Figure 64: PEER request (No Mapping Exists for the Internal Port
                                  Number)

   Version: 2
   R bit: Response (1)
   opcode: PEER (0x02)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   PEER Response:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Assigned External Port: 3938
    Assigned External IP Address: ::ffff:192.0.2.1
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

     Figure 65: PEER response (No Mapping Exists for the Internal Port
                                  Number)

8.2.  A Mapping Exists for the External Port Number

   In reference to Figure 63, the content of exchanged PEER messages
   when a mapping is maintained by the PCP server for the indicated
   external port number:











Boucadair              Expires September 24, 2015              [Page 32]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Request (0)
   opcode: PEER (0x02)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   PEER Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

      Figure 66: PEER request (A Mapping Exists for the External Port
                                  Number)

   Version: 2
   R bit: Response (1)
   opcode: PEER (0x02)
   Result Code: CANNOT_PROVIDE_EXTERNAL
   Lifetime: 0 sec
   Epoch Time: 36000

     Figure 67: PEER response (A Mapping Exists for the External Port
                                  Number)

8.3.  External IP Address Cannot be Honored

   In reference to Figure 63, the content of exchanged PEER messages
   when the suggested external IP address does not match an existing
   mapping is shown below:

   Version: 2
   R bit: Request (0)
   opcode: PEER (0x02)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   PEER Request:
    Mapping Nonce: 15685
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:192.0.2.5
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

      Figure 68: PEER request (External IP Address Cannot be Honored)



Boucadair              Expires September 24, 2015              [Page 33]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: PEER (0x02)
   Result Code: CANNOT_PROVIDE_EXTERNAL
   Lifetime: 0 sec
   Epoch Time: 36000

     Figure 69: PEER response (External IP Address Cannot be Honored)

8.4.  Extend the Lifetime

   In reference to Figure 70, the content of exchanged PEER messages to
   extend the lifetime of a mapping.

   +------+                           +------+
   | PCP  |                           | PCP  |
   |Client|                           |Server|
   +------+                           +------+
       |      (a) TCP SYN(src:3938)       |
       |--------------------------------->|
       |      (1) PCP PEER Request        |
       |--------------------------------->|
       |      (2) PCP PEER Response       |
       |<---------------------------------|
       |                                  |


                 Figure 70: Example of creating a mapping

   Version: 2
   R bit: Request (0)
   opcode: PEER (0x02)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   PEER Request:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 3938
    Suggested External Port: 0
    Suggested External IP Address: ::ffff:0.0.0.0
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

               Figure 71: PEER request (Extend the Lifetime)







Boucadair              Expires September 24, 2015              [Page 34]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: PEER (0x02)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   PEER Response:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 3938
    Assigned External Port: 11000
    Assigned External IP Address: ::ffff:192.0.2.1
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

              Figure 72: PEER response (Extend the Lifetime)

8.5.  Learn the Lifetime of a Mapping

   In reference to Figure 70, the content of exchanged PEER messages to
   learn the lifetime of a mapping is shown below:

   Version: 2
   R bit: Request (0)
   opcode: PEER (0x02)
   Requested Lifetime: 5 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   PEER Request:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 3938
    Suggested External Port: 0
    Suggested External IP Address: ::ffff:0.0.0.0
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

         Figure 73: PEER request (Learn the Lifetime of a Mapping)














Boucadair              Expires September 24, 2015              [Page 35]


Internet-Draft              PCP Flow Examples                 March 2015


   Version: 2
   R bit: Response (1)
   opcode: PEER (0x02)
   Result Code: 0
   Lifetime: 20000 sec
   Epoch Time: 1250
   PEER Response:
    Mapping Nonce: 15685
    Protocol: TCP (6)
    Internal Port: 3938
    Assigned External Port: 11000
    Assigned External IP Address: ::ffff:192.0.2.1
    Remote Peer Port: 12456
    Remote IP Address: ::ffff:198.51.100.2

        Figure 74: PEER response (Learn the Lifetime of a Mapping)

9.  Version Negotiation

   The following exchange occurs between a PCP client that supports PCP
   version 1 and the PCP server that supports PCP version 2.

   Version: 1
   R bit: Request (0)
   opcode: MAP (0x01)
   Requested Lifetime: 36000 sec
   PCP client's IP Address: ::ffff:198.51.100.1
   MAP Request:
    Protocol: UDP (17)
    Internal Port: 3938
    Suggested External Port: 3938
    Suggested External IP Address: ::ffff:0.0.0.0

                   Figure 75: MAP request with Version 1

   Version: 2
   R bit: Response (1)
   opcode: MAP (0x01)
   Result Code: UNSUPP_VERSION (1)
   Lifetime: 0 sec
   Epoch Time: 3600

               Figure 76: MAP response (Unsupported Version)

   Version negotiation is specified in Section 9 of [RFC6887].






Boucadair              Expires September 24, 2015              [Page 36]


Internet-Draft              PCP Flow Examples                 March 2015


10.  Security Considerations

   PCP security considerations are discussed in [RFC6887].

11.  IANA Considerations

   This document has no IANA actions.

12.  Acknowledgements

   Many thanks to C.  Jacquenet and D.  Wing for the comments.

13.  References

13.1.  Normative References

   [RFC3849]  Huston, G., Lord, A., and P. Smith, "IPv6 Address Prefix
              Reserved for Documentation", RFC 3849, July 2004.

   [RFC5737]  Arkko, J., Cotton, M., and L. Vegoda, "IPv4 Address Blocks
              Reserved for Documentation", RFC 5737, January 2010.

   [RFC6887]  Wing, D., Cheshire, S., Boucadair, M., Penno, R., and P.
              Selkirk, "Port Control Protocol (PCP)", RFC 6887, April
              2013.

   [RFC7220]  Boucadair, M., Penno, R., and D. Wing, "Description Option
              for the Port Control Protocol (PCP)", RFC 7220, May 2014.

   [RFC7225]  Boucadair, M., "Discovering NAT64 IPv6 Prefixes Using the
              Port Control Protocol (PCP)", RFC 7225, May 2014.

13.2.  Informative References

   [I-D.cheshire-pcp-unsupp-family]
              Cheshire, S. and S. Perreault, "Updates to the PCP
              Specification", draft-cheshire-pcp-unsupp-family-06 (work
              in progress), October 2013.

Author's Address

   Mohamed Boucadair
   France Telecom
   Rennes  35000
   France

   Email: mohamed.boucadair@orange.com




Boucadair              Expires September 24, 2015              [Page 37]