Re: [Ledger] AGENDA - Interledger Call - 23 January - 3pm UTC

Adrian Hope-Bailie <adrian@hopebailie.com> Wed, 23 January 2019 13:08 UTC

Return-Path: <adrian@hopebailie.com>
X-Original-To: ledger@ietfa.amsl.com
Delivered-To: ledger@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 20EDA126F72 for <ledger@ietfa.amsl.com>; Wed, 23 Jan 2019 05:08:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=hopebailie.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 oeytIg3wXxKf for <ledger@ietfa.amsl.com>; Wed, 23 Jan 2019 05:08:20 -0800 (PST)
Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) (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 40BE11228B7 for <ledger@ietf.org>; Wed, 23 Jan 2019 05:08:20 -0800 (PST)
Received: by mail-ot1-x341.google.com with SMTP id u16so1814121otk.8 for <ledger@ietf.org>; Wed, 23 Jan 2019 05:08:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hopebailie.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/R4dic7wZ2W+wYICV/Kl6+rxrbZqDmtnFJG+rRgmIyI=; b=E48Lj/ezvHe1+ouiRmV9jLE+ieaui49CR6mi2TjxjuKsT3ysivn4+9izMQn94wawpc MpPHDznCEbLhfaXeFFTIs/fnnyZn/WdPuiPZWNAvceUcv3ryKOkEI7YAjGwb26bQWbY5 jmRDjwSnzw5WwElcyZ1cglIjz0LkGS6yI/62Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/R4dic7wZ2W+wYICV/Kl6+rxrbZqDmtnFJG+rRgmIyI=; b=EW8Srfq8W80RH5AmlwnYPsVQ6Wh3Uc2SAqLZZWtr1IgU5yu5YAaRUtph+dZUO4injX w/D0x5e81x8eQoGJmnR9ixY8+E2rS+UTdRHJfQ+rZY17lRcEPKjvItHZmEN/ERNM+Pqv CyEa6C+sS87xF9M6EAlyBGECkkLN/a+dNi1TqemZ63qmLnyvn3r20fSX6hyxjaLBxCwZ rTOxxhO+oRcxn2hj8ZHLAPDEdX9LrW15xlT8/PAG5iGrCvKpPP5cXlziCUVsQW36uIVV zGvsJNqVjG2IWapIFQgkp/35CchOtVVpOK4DUjz7m+sh/eFnaZ9LvQsgwhkBaIKqWQOD 2MyQ==
X-Gm-Message-State: AJcUukcKoMjeqpIwxzyOXvFcNZ3GH0EJPjLzcjCmifWUprgMYTMORIjc fIO8YSdOlmLJNIXaV4lmRoYQslmuQkI2YTeEAfBPfw==
X-Google-Smtp-Source: ALg8bN7/NxOI+v/DHlVdXDDHQDQqk/GRFziDibCwbhu1VjhXwCjUg867FUbnMuNS1mxYnagC8KwPGOhwsezUGLGWDjE=
X-Received: by 2002:a9d:7cd9:: with SMTP id r25mr1322625otn.110.1548248899078; Wed, 23 Jan 2019 05:08:19 -0800 (PST)
MIME-Version: 1.0
References: <CA+eFz_KQDLH+msT4xJvNXcO4FXYSCVZ1irksfU4NT5bWp2wVJQ@mail.gmail.com> <1548198536.local-2e8cb3d8-634d-v1.5.5-b7939d38@getmailspring.com>
In-Reply-To: <1548198536.local-2e8cb3d8-634d-v1.5.5-b7939d38@getmailspring.com>
From: Adrian Hope-Bailie <adrian@hopebailie.com>
Date: Wed, 23 Jan 2019 15:08:06 +0200
Message-ID: <CA+eFz_J1csdDcVzdg-Fmv9=X_UCKd5UOzBED4kPCs8gnTmYF=g@mail.gmail.com>
To: Evan Schwartz <evan@ripple.com>
Cc: Interledger Community Group <public-interledger@w3.org>, Interledger Mailing List - IETF <ledger@ietf.org>, Hyperledger Quilt Mailing List <hyperledger-quilt@lists.hyperledger.org>
Content-Type: multipart/alternative; boundary="000000000000a763d505801fc9d4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ledger/viVJjDWDag3VoZU1eapH0_8yGMY>
Subject: Re: [Ledger] AGENDA - Interledger Call - 23 January - 3pm UTC
X-BeenThere: ledger@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion of interledger, originally a protocol stack for moving digital assets \(making payments\) between accounts operating on different payment networks or ledgers." <ledger.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ledger>, <mailto:ledger-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ledger/>
List-Post: <mailto:ledger@ietf.org>
List-Help: <mailto:ledger-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ledger>, <mailto:ledger-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 23 Jan 2019 13:08:23 -0000

Hey Evan,

Thanks for sharing. Some thoughts on your blog post, we can discuss further
on the call:

Many of the issues you highlight with BTP are not issues with WebSockets
themselves but more with how we have used it. E.g. We should be hosting
WebSocket servers that listen on a single port and path and then use a
proper auth during the handshake. If you do that, the subsequent messages
sent over the underlying TCP connection are very light on framing and
meta-data.

>From my research WebSockets are one of the most efficient and well
standardised framing protocols available over a raw TCP socket. Binary
WebSocket frames have very little overhead and all of the session context
is dealt with up front in the handshake. If you compare this to HTTP (and
HTTP2) you have a lot of overhead in the headers (i.e. sent with every
message).

Request/reply matching is a key feature requirement of bilateral protocols
in ILP but I think we've overblown the complexity required in
implementations when you consider that an ILP request/reply pair should be
very short lived and that by simply using TCP you already have many of the
delivery guarantees you need.

HTTP is only capable of request/reply matching because it only allows a
request to be sent after a previous reply has been received on the same
connection. i.e. You can only send requests serially. Any ILP connections
using HTTP 1 or 1.1 will be very inefficient unless they open multiple
connections.

HTTP/2 gets over this by mutiplexing the connection through streams. But
under the hood this is just another framing protocol (like WebSockets) and
giving those frames a stream id. Users of the HTTP/2 connection then still
need to explicitly create new streams for each request/reply pair if they
want to avoid head-of-line blocking. It's likely that the way this is
implemented in clients is likely to be highly optimised given the
popularity of HTTP/2, but given that streams have a complex state machine
that the client must manage it seems unlikely that it can be optimised
further than a simple request/reply protocol using a correlation id. (i.e.
simply adding a correlation id to the header of a packet and sending in a
binary WebSocket frame is definitely more efficient in theory but in
practice will come down to implementations).

The one aspect of WebSockets that may be hurting performance is the masking
which means that payloads need to be pre-processed before being sent. That
said, it's a very efficient algorithm so we'd need to test it to be sure
it's an issue.

A concern I have with the cluster of stateless connectors is the latency
you'll introduce if the connector must do a balance check against a DB for
each packet. This can be optimised to a point but in reality the most
efficient way to do this will be to ensure the stickiness at the load
balancer routes packets from the same peer to the same connector. Not sure
this will be useful in a scenario where both peers are routing high volumes
of packets (e.g. Coil and Strata).

That said, I think decoupling the messaging from the clearing and
settlement (FYI: forwarding ILP packets isn't clearing, clearing involves
reconciliation and netting, but that's a different issue) will be a huge
improvement to the architecture. As I've mentioned before, this is the
common pattern in most payments. We've been discussing how we could
implement this in the reference connector and hope to do some experiments
in this regard when we are back from the Mojaloop convening next week.

Lastly, I don't think hosting an HTTP server should be treated as a light
requirement. I'd still like to be able to accept payment on a connection
that I establish to my ILSP (i.e. I am the client) and have some
third-party host my SPSP server. Assuming that the ILP receiver and SPSP
server are the same thing is a mistake in my opinion and imposes
unnecessary limitations on the architecture.

Question: Why not transmit the ILP packets with the packet headers as HTTP
headers and the data payload as the body? In place byte replacement for
packet forwarding is not going to help much if you are framing and
de-framing the packets off the wire anyway.

All in, there are some great ideas in the blog but I don't think they all
depend on changing the bilateral protocol (although I do still want to
propose some better options than BTP).

I'm keen to get agreement on a basic JS interface that is agnostic to the
underlying wire protocol and then we can ship HTTP, WebSocket and any other
implementation (I'll try and implement your HTTP protocol in JS as soon as
it's stable).

Adrian




On Wed, 23 Jan 2019 at 01:11, Evan Schwartz <evan@ripple.com> wrote:

> I just wrote up this blog post describing my proposal for making
> connectors stateless and switching bilateral communication to HTTP: Thoughts
> on Scaling Interledger Connectors
> <https://medium.com/@emschwartz/thoughts-on-scaling-interledger-connectors-7e3cad0dab7f>
> :
> <https://medium.com/@emschwartz/thoughts-on-scaling-interledger-connectors-7e3cad0dab7f>
> How I Learned to Stop Worrying and Love HTTP
> <https://medium.com/@emschwartz/thoughts-on-scaling-interledger-connectors-7e3cad0dab7f>
>
> Looking forward to hearing your thoughts and discussing on tomorrow's call!
> Evan
>
> On Jan 22 2019, at 2:17 pm, Adrian Hope-Bailie <adrian@hopebailie.com>
> wrote:
>
> Hi all,
>
> Evan has been working on a new HTTP-based bilateral protocol which he'll
> be chatting about on the call tomorrow. Look out for a follow up mail from
> him with some details.
>
> As usual, if you have any other topics to bring to the call please do!
>
> Join from PC, Mac, Linux, iOS or Android: https://zoom.us/s/377506344
> <http://email.zoom.us/track/click/30854053/zoom.us?p=eyJzIjoiM0w2aVdDeVIxQS1QMWFUY2dOWDNqRF9FXzg4IiwidiI6MSwicCI6IntcInVcIjozMDg1NDA1MyxcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL3pvb20udXNcXFwvc1xcXC8zNzc1MDYzNDRcIixcImlkXCI6XCI1NzY5ZmNlY2IyMTA0YjJlOGY5NTdjZDNkMzU3MDQxMlwiLFwidXJsX2lkc1wiOltcImY3NTEyMWVkZGI2NDQ2YjA4YzI1ODAxNjdiMWQ5ODlhM2MyY2FmMTZcIl19In0>
>
> Or iPhone one-tap:
>     US: +14086380968,,377506344# or +16468769923,,377506344#
>
> Or Telephone:
>     Dial(for higher quality, dial a number based on your current
> location):
>     US: +1 408 638 0968 <+1%20408%20638%200968> or +1 646 876 9923
> <+1%20646%20876%209923> or +1 669 900 6833 <+1%20669%20900%206833>
>     Meeting ID: 377 506 344
>     International numbers available: https://zoom.us/u/cbrUAzE3W
> <http://email.zoom.us/track/click/30854053/zoom.us?p=eyJzIjoiTkhxZ1pWcWZEbDlWZy1VaTBYTnFqX2RwcUs0IiwidiI6MSwicCI6IntcInVcIjozMDg1NDA1MyxcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL3pvb20udXNcXFwvdVxcXC9jYnJVQXpFM1dcIixcImlkXCI6XCI1NzY5ZmNlY2IyMTA0YjJlOGY5NTdjZDNkMzU3MDQxMlwiLFwidXJsX2lkc1wiOltcImY3NTEyMWVkZGI2NDQ2YjA4YzI1ODAxNjdiMWQ5ODlhM2MyY2FmMTZcIl19In0>
>
> _______________________________________________
> Ledger mailing list
> Ledger@ietf.org
> https://www.ietf.org/mailman/listinfo/ledger
>
>