Subject: [pcp] Comments on PCP Port set 06

From: Reinaldo Penno <[email-masked]>
Date: Tue, 12 Aug 2014 11:27:11 -0700

1 - In the text below there is a reference to a "requested External Port Set" but there is no such
field in the new option. Maybe there was some time back, but not anymore.

"   If the PREFER_FAILURE option is present and the PCP server is unable
    to map all ports in the requested External Port Set or is unable to
    preserve parity (P = 1), the CANNOT_PROVIDE_EXTERNAL error is
    returned."

2 -

Reading below my understanding is that the first internal port set might be different
from the the Internal Port in the MAP header. So, if:

Req: Internal Port == 80  and First Internet Port == 80
Resp: First Internal Port = 1000

Is this valid? (and see below question (3))

"    First Internal Port:  In a request, this field MUST be set equal to
       the Internal Port field in the MAP opcode by the PCP client.  In a
       response, this field indicates the first internal port of the port
       set mapped by the PCP server, which may differ from the value sent
       in the request.  That is to be contrasted to the Internal Port
       field, which by necessity is always identical in matched requests
       and responses."

3 -

If the requests is successful, what would be the value of the Internal Port
field in the response?

"    If the mapping is successful, the MAP response's Assigned External
    Port is set to the first port in the External Port Set, and the
    PORT_SET option's Port Set Size is set to number of ports in the
    mapped port set.  The First Internal Port field is set to the first
    port in the Internal Port Set."

4 -

I'm confused by the different semantics of PREFER_FAILURE in the context of this draft.

 From 6887

"    This option indicates that if the PCP server is unable to map both
    the suggested external port and suggested external address, the PCP
    server should not create a mapping.  This differs from the behavior
    without this option, which is to create a mapping."

Now, contrast with this draft

"    In addition to regular MAP request processing, the following checks
    are made upon receipt of a PORT_SET option with non-zero Requested
    Lifetime:

    o  If multiple PORT_SET options are present in a single MAP request,
       a MALFORMED_OPTION error is returned.

    o  If the Port Set Size is zero, a MALFORMED_OPTION error is
       returned.

    If the PREFER_FAILURE option is present and the PCP server is unable
    to map all ports in the requested External Port Set or is unable to
    preserve parity (P = 1), the CANNOT_PROVIDE_EXTERNAL error is
    returned."

Key here is the statement "in addition to regular MAP request...". What happens if the Suggested
External Port is non-zero in the request? Does it mean that the range must include that port?

Meaning, let's suppose the server can provide the number of ports requests and everything else but the
external port range does not encompass the Suggested External Port?

5 -

"    A PCP client attempting to refresh or delete a port set mapping MUST
    include the PORT_SET option in its request."

Even if the response from the server did not contain a PORT SET OPTION?

---

From: Simon Perreault <[email-masked]>
Date: Tue, 12 Aug 2014 14:47:27 -0400

Reinaldo,

Thanks for your review!

Here are my answers to your questions. Let me know if you think that
text changes are necessary.

>    preserve parity (P = 1), the CANNOT_PROVIDE_EXTERNAL error is

Doesn't the requested external port set starts from the suggested
external port (in the MAP opcode)? Or am I misunderstanding?

> Is this valid? (and see below question (3))

Yes, it is valid and expected.

>    port in the Internal Port Set."

It is copied from the request. This is necessary so that clients can
match requests with responses.

> External Port is non-zero in the request? Does it mean that the range must

It means that the client wishes the external port set to start with that port.

> external port range does not encompass the Suggested External Port?

What I think you're suggesting is we need a way for the client to
request exactly N ports and no fewer but not care about which external
ports are chosen by the server. Correct?

> Even if the response from the server did not contain a PORT SET OPTION?

Well, a port *set* mapping will always use the PORT_SET option,
otherwise it would be a regular port mapping...

Thanks,
Simon

---

From: Reinaldo Penno <[email-masked]>
Date: Tue, 12 Aug 2014 14:23:48 -0700

Hi,

Inline with [RP2]

> external port (in the MAP opcode)? Or am I misunderstanding?
[RP2]

I could not find anything in the text that suggests that. I could find 
something that actually seems to contradict that

"

The External Port Set
    is respectively defined as being the range of Port Set Size ports
    starting from the Assigned External Port. "

Reading this I would understand the external port set is fully dictated 
by the Server.

> Yes, it is valid and expected.

[RP2] This means a server might have to release the socket and try to 
find to port 1000, which might actually be taken, right?
> match requests with responses.

[RP2] I could not find anything in the normative text about this 
behavior. I could only find in the examples.

> It means that the client wishes the external port set to start with that port.

[RP2] I'm not sure I agree. It could only mean that the external port 
should be present on the set. This would make
getting a range much easier.  But irrespective, nothing in the normative 
text talks about this issue.

> ports are chosen by the server. Correct?

[RP2] Not really.

> otherwise it would be a regular port mapping...

[RP2] Let me elaborate.

Req: contains PORT SET OPTION
Resp: does not contain PORT SET OPTION (client receives only one port back)

Refresh/Req: Does it need to have PORT SET OPTION?

Irrespective of the answer, I could not find normative text about it.