Re: [pcp] How can I make a ~stateless forwarding PCP proxy again?

Markus Stenberg <markus.stenberg@iki.fi> Wed, 14 May 2014 10:50 UTC

Return-Path: <markus.stenberg@iki.fi>
X-Original-To: pcp@ietfa.amsl.com
Delivered-To: pcp@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 89F6E1A004A for <pcp@ietfa.amsl.com>; Wed, 14 May 2014 03:50:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NaUtPgZIxfZb for <pcp@ietfa.amsl.com>; Wed, 14 May 2014 03:50:26 -0700 (PDT)
Received: from kirsi1.inet.fi (mta-out1.inet.fi [62.71.2.199]) by ietfa.amsl.com (Postfix) with ESMTP id B9AC91A0041 for <pcp@ietf.org>; Wed, 14 May 2014 03:50:25 -0700 (PDT)
Received: from [192.168.43.129] (80.220.67.193) by kirsi1.inet.fi (8.5.140.03) (authenticated as stenma-47) id 534D34B5023290E7; Wed, 14 May 2014 13:50:12 +0300
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\))
From: Markus Stenberg <markus.stenberg@iki.fi>
In-Reply-To: <320291FF-E45B-40E6-9D54-617419713506@cisco.com>
Date: Wed, 14 May 2014 13:50:11 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <4F94795C-EF78-4579-82C7-F1CB538D75AF@iki.fi>
References: <FDB45976-B7A3-4C59-B2D1-C01982D0205F@iki.fi> <45A697A8FFD7CF48BCF2BE7E106F06040B8C957D@xmb-rcd-x04.cisco.com> <2B975F36-4E46-4D93-891B-DB4E480FF190@iki.fi> <320291FF-E45B-40E6-9D54-617419713506@cisco.com>
To: Dan Wing <dwing@cisco.com>
X-Mailer: Apple Mail (2.1874)
Archived-At: http://mailarchive.ietf.org/arch/msg/pcp/zQOw_aDZq7g8kCtzHe_Y31w_-f0
Cc: "pcp@ietf.org" <pcp@ietf.org>
Subject: Re: [pcp] How can I make a ~stateless forwarding PCP proxy again?
X-BeenThere: pcp@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: PCP wg discussion list <pcp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/pcp>, <mailto:pcp-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/pcp/>
List-Post: <mailto:pcp@ietf.org>
List-Help: <mailto:pcp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/pcp>, <mailto:pcp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 14 May 2014 10:50:28 -0000

On 6.5.2014, at 9.01, Dan Wing <dwing@cisco.com> wrote:
> On May 5, 2014, at 1:14 PM, Markus Stenberg <markus.stenberg@iki.fi> wrote:
>> On 5.5.2014, at 21.41, Reinaldo Penno (repenno) <repenno@cisco.com> wrote:
>>> we had this discussion in the past but and I, for one, backed the idea of PCP being able to support stateless proxies.  So, you are not alone there but maybe you want to write a draft about it so the WG can discuss it.
>> 
>> 
>> Nods. Personally I like to minimize the amount of state in a system, so I’m a fan of stateless designs. My current design for a proxy has just 3 logical pieces of ‘state’ per supported remote server:
>> 
>> - (client) source prefix + prefix length to match
>> - address of the server
>> - server epoch + when was it received
>> 
>> And currently I’m trying to make sure it’s actually doable to do all I want with just that and few hundred lines of C. After looking at how big PCP client libraries are, last thing I want is really PCP client glued to PCP server.
>> 
>> Getting back to my previous question, now that I think of it, actually, the IP address of the client is in the THIRD_PARTY option. Only thing that isn’t explicitly stored somewhere is the address client contacts the proxy on (it probably has 1-N addresses per M interfaces). If proxy uses same source address for talking with server as client used to contact it (with different port, obviously), it should work fine, without per-client or per-request state. 
>> 
>> e.g.
>> 
>> C -> P [IntIP=C]
>> P -> S [IntIP=P, TP=C]
>> S -> P [TP=C]
>> P -> C [no TP]
>> 
>> Beyond that, some ANNOUNCE handling is needed, but as long as you stick to multicast, that can be also stateless. (Connected clients know if they have state with the particular proxy that spams ANNOUNCEs.)
>> 
>> Perhaps I’ll write up about it somewhere (pcp or homenet), although it’s more of an implementation detail draft, than actual protocol change requiring one.
>> 
>> Cheers,
>> 
>> -Markus
>> 
>> P.S. This scheme works fine with IPv4. With IPv6, it may have issues, when C contacts P using link-local address and I don’t think there is anything preventing that.
> 
> Correct, nothing prevents it.  But C is unable to show it owns another address (so can't use THIRD_PARTY), and link-local doesn't do anything on the other side of the router (firewall), so seems fruitless for C's PCP client to use link local.  I would even think P or any PCP server should just return an error if the PCP request came from an IPv6 link local address and the proxy (or PCP server) is not doing NPTv6 or NAT66.  Link local can’t go anywhere, so seems an error no matter if proxy or PCP server returns an error -- link-local won't do any good as a firewall rule because it isn't routable from the Internet.

The main problem is if this happens:

C uses GUA IPv6 address
 .. and has only link-local next-hop route to P to find IPv6 PCP server
=> contacts P with src = GUA, dst = link-local

=> P cannot meaningfully forward it to S using src = C’s linklocal.

I’m not sure how IPv6 PCP in general should work (I haven’t seen that many implementations of it in the wild), is it supposed to work only given DHCP* option?

Cheers,

-Markus