Re: [Anima-signaling] Draft message on proposed change to GRASP

Brian E Carpenter <brian.e.carpenter@gmail.com> Thu, 21 April 2016 02:07 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: anima-signaling@ietfa.amsl.com
Delivered-To: anima-signaling@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 46BB212DB7C for <anima-signaling@ietfa.amsl.com>; Wed, 20 Apr 2016 19:07:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 gVVmPN8grMfl for <anima-signaling@ietfa.amsl.com>; Wed, 20 Apr 2016 19:07:32 -0700 (PDT)
Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 436BF12D7E6 for <anima-signaling@ietf.org>; Wed, 20 Apr 2016 19:07:32 -0700 (PDT)
Received: by mail-pf0-x22f.google.com with SMTP id 184so24520075pff.0 for <anima-signaling@ietf.org>; Wed, 20 Apr 2016 19:07:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=TPfhj6mJczmTd2Scy2EgNF0YIraNnlqlaeRwhh27P2w=; b=0uCDNcsPIo95Rhg//voIx6shDPAWfzB4+WNGKmP17DPWvc0EIDBMW5BY6ZPGoY1DFf Z4CRh4LaCn9gLNKtYxiBKL/PUGhEFYxV4DdgEj7rry7x8WU4+MyllJrqyvnt/CQBnQos J2zMkIZJ+THt73W73ffDfYbC3WG6WFMV1siidRGTVbsn+wrtn8JD73o1/AyD+uj5UBJc Y3eAVOfQWO2Uqm5QJkicDVTXR+0uZcD4RZZWiXM14L0oZw4q0jN70/hqoiUx0xiVxFSp 1OR9jojp6W92Z+smIyPRr0gj8/456T3WELSR8WSPTOrNFhx6H/AKKFY0AKMj5dD7z0Ay UsFw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=TPfhj6mJczmTd2Scy2EgNF0YIraNnlqlaeRwhh27P2w=; b=QpTY179HurDqZybWgFe1iZ6HpWXvcKIHT9M6TbgOySqUNuKMV/YRx6cFjD5Qrn5i11 6zFYAsHmaPTy3GeIENBQ50EKHuFgP/Jtnz+HgOPtCx8rdrGLyUi5D7Urvi58ECZkXf6B xlo1IqegPnFJTnm4nfq72oyQbx4f9iIHCjqHEGx7Gt+XQaFy6ha30NEX3gMGg7GET/kJ Vdr3h576k7aXSGCpdtj4QHs7P6zaghM47z/SmpaizhqvHrc+6aFOGvdUSzjEhfc9nGeH LYsTIFXoED6qdvojcY/DPervQxiuB2n5zelTyPrnZDrYNbXUQDrG83jCTGH+nmtvmHLu QQ4A==
X-Gm-Message-State: AOPr4FXCIpHvJmfpsJW8xVDS0b5Gz4hugOI+V6pohcz2DexlU+4YElJ9s0MGip6X6EI9VQ==
X-Received: by 10.98.43.7 with SMTP id r7mr17056664pfr.24.1461204451701; Wed, 20 Apr 2016 19:07:31 -0700 (PDT)
Received: from ?IPv6:2406:e007:4b0f:1:28cc:dc4c:9703:6781? ([2406:e007:4b0f:1:28cc:dc4c:9703:6781]) by smtp.gmail.com with ESMTPSA id u2sm302950pfi.26.2016.04.20.19.07.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 19:07:30 -0700 (PDT)
To: Toerless Eckert <eckert@cisco.com>, "jmh.direct" <jmh.direct@joelhalpern.com>
References: <rp2lvm5kwna9glg8ejv0hq4y.1461186275978@email.android.com> <20160420214641.GG17761@cisco.com>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <571835E6.3020908@gmail.com>
Date: Thu, 21 Apr 2016 14:07:34 +1200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <20160420214641.GG17761@cisco.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/anima-signaling/NxSr_ve7QHTQ2siUYQCAXqtHN50>
Cc: "Joel M. Halpern" <jmh@joelhalpern.com>, Anima signaling DT <anima-signaling@ietf.org>
Subject: Re: [Anima-signaling] Draft message on proposed change to GRASP
X-BeenThere: anima-signaling@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Mailing list for the signaling design team of the ANIMA WG <anima-signaling.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima-signaling/>
List-Post: <mailto:anima-signaling@ietf.org>
List-Help: <mailto:anima-signaling-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima-signaling>, <mailto:anima-signaling-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2016 02:07:34 -0000

On 21/04/2016 09:46, Toerless Eckert wrote:
> Joel: Would definitely be safest if ASAs would have separate UDP and
> TCP transport addresses. On the other hand, you can search for a port
> free on both TCP/UDP. But probably thats not considered architecturally clean.

It isn't, but it can be done (Python code fragment below).
We can certainly avoid this by tagging the port number with the
transport protocol, which adds a few more bytes to the discovery
response. It's a matter of what we think is least bad - different
ports for each transport protocol, or some messy code.

  Brian

        # Set up TCP and UDP listening sockets on a free port

        for i in range(10):
            listen_sock=socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
            listen_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
            listen_sock.bind(('',0))
            listen_port = listen_sock.getsockname()[1]

            # try to grab the same port for UDP
            ulisten_sock=socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
            try:
                ulisten_sock.bind(('',listen_port))
                break # we're done
            except:
                # could not get the same port
                if i==9:
                    # failed 10 times, give up
                    raise RuntimeError("Ten successive port clashes")
                listen_sock.close()
                ulisten_sock.close()
                continue # try again

> 
> 
> On Wed, Apr 20, 2016 at 02:04:35PM -0700, jmh.direct wrote:
>> How common is the case of an ASAP wanting to use both TCP and UDP?  If it is not rare, the requirement to get the same ephemeral port in both stacks seems tricky to meet in an operational system.
>> Yours,Joel
>>
>>
>> Sent via the Samsung Galaxy S® 6, an AT&T 4G LTE smartphone-------- Original message --------From: Brian E Carpenter <brian.e.carpenter@gmail.com> Date: 4/20/2016  1:50 PM  (GMT-08:00) To: Anima signaling DT <anima-signaling@ietf.org>rg>, "Joel M. Halpern" <jmh@joelhalpern.com> Subject: Draft message on proposed change to GRASP 
>> Hi,
>>
>> Design team, and Joel,
>>
>> Some of us have been discussing a GRASP design issue raised by Toerless.
>> There was quite a long off-list thread (nothing secret, so if people are
>> interested we could make it available). But here is a draft of a proposal
>> to the WG. Please comment - especially, does the text make sense? The actual
>> decision belongs to the WG, of course.
>>
>> Short version:
>>
>> We propose that when an ASA listens for negotiation or synchronization requests,
>> it should do so on its own port number rather than sharing the generic GRASP
>> port number as currently defined. The consequence for the protocol is that
>> discovery responses must include a complete transport address (locator+port)
>> instead of just the locator.
>>
>> Long version:
>>
>> We want ASAs to run as separate modules in user address space, as applications,
>> rather than being bundled with the GRASP engine in kernel space. To achieve this
>> with all ASAs listening on the same port number would require quite complicated
>> inter-process communication between the GRASP kernel and the indvidual ASAs.
>> The details of this would be different in every operating system. If we
>> allow each ASA to have its own port this can be avoided, and each ASA can have
>> its own copy of the GRASP API library if required. This will make the systems
>> engineering of portable ASAs much easier, and will make the adaptation of
>> the GRASP API library and the GRASP kernel to various operating systems easier
>> too.
>>
>> We propose to redefine the locator returned by GRASP discovery accordingly. For
>> the IPv6 case that would give:
>>
>> locator-option /= [ipv6-locator-option, port-number]
>> ipv6-locator-option = bytes .size 16
>> port-number = 0..65535
>>
>> We did consider making this optional, but that would raise interoperability
>> issues. If an implementation does choose to use the GRASP_LISTEN_PORT
>> for all ASAs, that could simply be returned as the port-number.
>> (Alternatively, we could define that port-number==0 means GRASP_LISTEN_PORT,
>> but that seems like optimisation of a corner case.)
>>
>> Implementation note:
>>
>> An ASA will obtain an ephemeral port number when it starts up and that
>> will be used in discovery responses. If more than one transport protocol
>> is to be used, it will need to secure the same port number for each protocol.
>> For example, if it gets port X when binding to a TCP socket, it must then
>> bind to port X on a UDP socket.
>>
>> Note:
>>
>> Toerless Eckert brought up this problem and outlined the proposed solution.
>>
>>
>>
> 
>> _______________________________________________
>> Anima-signaling mailing list
>> Anima-signaling@ietf.org
>> https://www.ietf.org/mailman/listinfo/anima-signaling
> 
>