# Distributed Pathfinding - Routing without a common routing table

**URL:** <https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88>\
**Category:** General Questions\
**Created:** [February 6, 2019, 7:02pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88 "2019-02-06T19:02:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarmaCoverage](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/karmacoverage/32/40_2.png) [@KarmaCoverage](https://forum.interledger.org/u/KarmaCoverage)\
**Post date:** [February 6, 2019, 7:02pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/1 "2019-02-06T19:02:00Z")

</div>

Firstly, thank you guys for putting up an ILP dedicated forum to discuss this stuff.

This came to me while thinking about how ILP abstracts away Rippled’s pathfinding functionality. When I was listening to [this](https://zoom.us/recording/play/JzueyXRdTHFA2XbXxGm12p69V1DMB39LT4wnGSAhKPB58XRkw2pmB9GRdU66Kc5L?continueMode=true) ILP community call with @adrianhopebailie’s comment at 33:20 and the conversation around routing, I thought this may be helpful.

The basic idea here, starts from me thinking about XRPLedger as a Connector within the framework of an open IoV, and the use of it’s pathfinding functionality as a sort of ‘freely available routing service’. Which leads to an IoV environment in which Market Makers aka Connectors must compete against the free service provided by XRPLedger.

From there I started thinking about RippleNet, _assuming_ that each bank runs their own Rippled ledger which has it’s own pathfinding functionality, and _further assuming_ that IOUs could be issued onto that banks private Rippled ledger representing the terms of their bilateral Nostro/Vostro relationships with other RippleNet banks… with the cost/spread represented as [Quality In/Out](https://developers.ripple.com/rippleapi-reference.html#trustline) which means the terms/spreads between each Connector remains private to each Connector.

To find the relevant parts skip about 2/3s down the write up and start at _“Now with all that said… back to RippleNet”_

> **[How xPool may work? An attempted guess - Part 3 (April 18)](https://xrpcommunity.blog/untitled-4/)**
>
> This will begin with the idea of loaning XRP to Exchanges, for reasons explained in the previous segment, then I will take those ideas about lending XRP and point them towards Banks, and Central Banks as well as other xCurrent users. Exchanges &...

> **The big idea…** Once you have a series of banks, each with their N/V terms expressed on each other’s xCurrent ledgers via Quality in/out… then finding the best combination of many xCurrent ledger paths to send a payment through, is effectively **preforming distributed pathfinding across all relationships, in an automated way!!!**

---

<div class="post-metadata">

**Author:** ![emschwartz](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/emschwartz/32/12_2.png) [@emschwartz](https://forum.interledger.org/u/emschwartz)\
**Post date:** [February 6, 2019, 7:49pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/2 "2019-02-06T19:49:30Z")

</div>

I’m not sure I completely understand your question or idea, but Interledger connectors do route packets without having one shared routing table. Each connector has a routing table that maps ILP address prefixes to a specific peer or “next hop” that they’ll forward the packet to. Connectors broadcast routing information to one another to help build those tables and together all of the routing tables do effectively enable “distributed pathfinding”. Feel free to ask if you have more questions about how that routing protocol/algorithm works.

Also, please keep this forum focused on discussing the open Interledger protocol, rather than specific blockchains like XRP Ledger or proprietary products like xCurrent.

---

<div class="post-metadata">

**Author:** ![raspberryrippl3](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/raspberryrippl3/32/70_2.png) [@raspberryrippl3](https://forum.interledger.org/u/raspberryrippl3)\
**Post date:** [February 6, 2019, 7:57pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/3 "2019-02-06T19:57:23Z")

</div>

that’s how in understood it. if an ILP connector can’t help with a request, the process moves along to the next connector

---

<div class="post-metadata">

**Author:** ![KarmaCoverage](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/karmacoverage/32/40_2.png) [@KarmaCoverage](https://forum.interledger.org/u/KarmaCoverage)\
**Post date:** [February 6, 2019, 8:40pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/4 "2019-02-06T20:40:04Z")

</div>

> [@emschwartz](#):
>
> Each connector has a routing table that maps ILP address prefixes to a specific peer or “next hop” that they’ll forward the packet to.

Right, the idea is basically for a Connector to just use a private Rippled ledger and express their multi relationships with other connectors via issuing IOUs onto their own private ledger… then just letting the Connector’s private ledger’s Pathfinding identify the best route through that ledger in the ILP payment path

> [@emschwartz](#):
>
> Connectors broadcast routing information to one another

The Quality in/out can be changed, or different IOUs with various quality settings used (refelecting various spreads) then the Connector can move around and provision liquidity to the orderbooks and IOUs that sum up to the market rate spread.

The change in liquidity rates can be communicated through the fufill amounts, as those are recieved and the changes can be calculated.

Idk, maybe it does not make sense. I just think about all the work it would take to run a Connector, and then look at all the functionality already built into Rippled and think, “hum, maybe I could use this accounting tool for internal operations?”

I mean, what a connector does is, manage liquidity across multiple orderbooks with changing spreads continuously… which Rippled already does quite well.

---

<div class="post-metadata">

**Author:** ![emschwartz](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/emschwartz/32/12_2.png) [@emschwartz](https://forum.interledger.org/u/emschwartz)\
**Post date:** [February 6, 2019, 10:37pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/5 "2019-02-06T22:37:36Z")

</div>

You’re right that the functionality is somewhat similar, at least at a high level.

That said, I would bet that running purpose-built connector software would be best. There are plenty of features that are specific to Interledger (the details of ILP Address-based routing, settling using payment channels on different blockchains, the connector-to-connector communication, etc), and I think an implementation designed specifically for Interledger would handle them better than repurposed code.

---

<div class="post-metadata">

**Author:** ![KarmaCoverage](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/karmacoverage/32/40_2.png) [@KarmaCoverage](https://forum.interledger.org/u/KarmaCoverage)\
**Post date:** [February 6, 2019, 10:42pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/6 "2019-02-06T22:42:38Z")

</div>

> [@emschwartz](#):
>
> You’re right that the functionality is somewhat similar, at least at a high level.
> 
> That said, I would bet that running purpose-built connector software would be best.

Yeah, this was pretty much my thinking also.

I just figured with Rippled being opensource, a minimal amount of development work would need to be layered in to handle the ILP specific functionality. Which may make Rippled an attractive base ledger to build a reference Connector implementation on top of.

---

<div class="post-metadata">

**Author:** ![emschwartz](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/emschwartz/32/12_2.png) [@emschwartz](https://forum.interledger.org/u/emschwartz)\
**Post date:** [February 6, 2019, 10:44pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/7 "2019-02-06T22:44:21Z")

</div>

I would recommend just using the reference implementation of an interledger connector: [https://github.com/interledgerjs/ilp-connector](https://github.com/interledgerjs/ilp-connector)

---

<div class="post-metadata">

**Author:** ![justmoon](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/justmoon/32/38_2.png) [@justmoon](https://forum.interledger.org/u/justmoon)\
**Post date:** [February 6, 2019, 11:07pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/8 "2019-02-06T23:07:18Z")

</div>

> [@raspberryrippl3](#):
>
> that’s how in understood it. if an ILP connector can’t help with a request, the process moves along to the next connector

Just to be clear, here is a description of how routing works in Interledger, at least how it works at present. It is very, very similar to how Internet routing works.

Any node (sender or connector) which is trying to send a packet will always consult its local routing table to decide which peer to send the packet to. That is it. Nodes never query each other to figure out where to send a given packet nor do they ever send a packet to more than one neighbor. If the local routing table is incorrect or if the requested destination isn’t covered in the local routing table, the packet will not arrive at its intended destination.

How nodes populate their local routing table depends on the type of node. For a client, the typical routing table is likely just hardcoded and says something like: “Send everything to my Interledger access provider.” At the other extreme, a tier 1 Interledger connector will have almost every possible destination in its routing table which it assembled from routing updates that are circulating via CCP (connector-to-connector protocol), a path vector routing protocol.

XRP Ledger pathfinding works very differently because the entire network topology is known by all participants, so we can calculate the entire route locally. This type of routing is sometimes called link-state routing. We went with path-vector routing for Interledger because it provides more flexibility and scalability in an open network setting. Also, because the Internet uses path-vector routing, there is a tremendous amount of research and experience that we can leverage.

---

<div class="post-metadata">

**Author:** ![KarmaCoverage](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/karmacoverage/32/40_2.png) [@KarmaCoverage](https://forum.interledger.org/u/KarmaCoverage)\
**Post date:** [February 6, 2019, 11:44pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/9 "2019-02-06T23:44:27Z")

</div>

> [@justmoon](#):
>
> Any node (sender or connector) which is trying to send a packet will always consult its local routing table to decide which peer to send the packet to. That is it.

I’m thinking of this with XRPLedger or any private Rippled acting as a Connector, consulting only its internal topology to determin the route/path through it’s internal connections to other Connectors.

Fyi these are new detail to me, but after looking at [this](https://upload.wikimedia.org/wikipedia/commons/a/a2/Path_Vector_Routing.pdf) to try and understand “vector routing” I think that methodology fits within the framework of what I wrote about.

In reality I think a lot of Rippled would need to be stripped out, and the pathfinding/arbatrage algo continuously improved upon. But maybe XRPLedger could play the role of a decentralized exchange / public ILP Connector?

If actual tear 1 Connectors issued IOUs on XRPLedger, that would open up an alternative path for liquidity to flow through without going through direct connector-to-connector paths. Like a distribited tear 1 ILSP.

Im sure I dont have the details ironed out, just sharing the direction of thought.

---

<div class="post-metadata">

**Author:** ![emschwartz](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/emschwartz/32/12_2.png) [@emschwartz](https://forum.interledger.org/u/emschwartz)\
**Post date:** [February 6, 2019, 11:48pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/10 "2019-02-06T23:48:11Z")

</div>

> [@KarmaCoverage](#):
>
> Like a distribited tear 1 ILSP.

I do think the idea of a decentralized connector is an interesting one (though I might _still_ opt for building one from scratch rather than trying to re-purpose such a complicated codebase).

---

<div class="post-metadata">

**Author:** ![KarmaCoverage](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/karmacoverage/32/40_2.png) [@KarmaCoverage](https://forum.interledger.org/u/KarmaCoverage)\
**Post date:** [February 7, 2019, 2:13am UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/11 "2019-02-07T02:13:06Z")

</div>

> [@emschwartz](#):
>
> though I might _still_ opt for building one from scratch rather than trying to re-purpose such a complicated codebase

What if it could be done via scripting, using the existing APIs that support Rippled?

_Trustline Quality_ communicates a lot, when you also consider Orderbook depth to be a parallel for “liquidity bandwidth”, or a liquidity curve. The tool is there, more or less.

Let an introductory rate IOU’s orderbook (the cheaper one) dry up, then let the Pathfinding algo auto reroute the payment’s path through liquidity on another IOUs orderbook which has a lower Quality, ie a higher spread for the Connector.

There are html wallets out there. Although I’m not technical enough to weigh in on if all of those features (trustline quality set, and order placing to manage liquidity depth) can be deployed through an html header or body, or just not possible… idk

---

<div class="post-metadata">

**Author:** ![Santiago\_Velez](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/santiago_velez/32/400_2.png) [@Santiago\_Velez](https://forum.interledger.org/u/Santiago_Velez)\
**Post date:** [November 11, 2019, 11:16pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/12 "2019-11-11T23:16:59Z")

</div>

Can a global liquidity provider (like a Moneygram) become a Tier 1 ILP connector with a massive global routing table? Also, how do connectors compete with one another if only the local routing table is consulted? Who decides for the sender whom is on the local routing table? Thanks in advance for the replies.

---

<div class="post-metadata">

**Author:** ![matdehaast](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/matdehaast/32/191_2.png) [@matdehaast](https://forum.interledger.org/u/matdehaast)\
**Post date:** [November 28, 2019, 12:21pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/13 "2019-11-28T12:21:22Z")

</div>

Welcome @Santiago_Velez.

Moneygram could become a tier 1 provider. A global routing table is a loaded term and would depend how they decided to deploy there infrastructure.

**Option 1**  
One option would be to run a large connector that supported all their various currencies. All clients would then connect to this connector and allow routing across all currencies supported. This would effectively give you the concept of a `large global routing table`. Though the question would be what legal jurisdiction does this connector operate in.

**Option 2**  
Another is Moneygram would run connectors in all the markets/jurisdictions it wants to operate within (USA, Europe, Australia etc) and then peer all their connectors peers with eachother. There wouldn’t be a `global routing table` but the Interledger network would handle that for you.

For me it is far more likely they would operate with Option 2 as I suspect that would be the only way to actually conform to current legal compliance regarding Money Transmission etc.

Matt

---

<div class="post-metadata">

**Author:** ![Lucian\_Trestioreanu](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/lucian_trestioreanu/32/186_2.png) [@Lucian\_Trestioreanu](https://forum.interledger.org/u/Lucian_Trestioreanu)\
**Post date:** [November 28, 2019, 3:46pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/14 "2019-11-28T15:46:23Z")

</div>

I saw _“CCP”_ and _“RBP”_ used in different places.  
What is their present, and intended future relationship, please?

> <https://github.com/dora-gt/rfcs/blob/feature/dora-gt/route-broadcasting-protocol/0000-route-broadcasting-protocol/0000-route-broadcasting-protocol.md>

> <https://github.com/interledger/rfcs/blob/master/0033-relationship-between-protocols/0033-relationship-between-protocols.md>

> <https://github.com/interledgerjs/interledgerjs/blob/master/packages/ilp-protocol-ccp/src/index.ts>

[https://docs.rs/interledger/0.5.1/interledger/ccp/index.html](https://docs.rs/interledger/0.5.1/interledger/ccp/index.html)

* * *

At present, are there any differences in how routing updating works between the Rafiki, Reference, Rust, Java connectors? Are/SHOULD the implementations be able to exchange compatible routing info, or there will/can be different “route gossipping” on the network?

---

<div class="post-metadata">

**Author:** ![sappenin](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.interledger.org/sappenin/32/41_2.png) [@sappenin](https://forum.interledger.org/u/sappenin)\
**Post date:** [December 9, 2019, 3:21pm UTC](https://forum.interledger.org/t/distributed-pathfinding-routing-without-a-common-routing-table/88/15 "2019-12-09T15:21:09Z")

</div>

> [@Lucian\_Trestioreanu](#):
>
> At present, are there any differences in how routing updating works between the Rafiki, Reference, Rust, Java connectors?

We don’t have any thorough integration tests yet to validate this, but the CCP implementations in Java, JS, and Rust should be compatible.
