Describe Multilateral Mode in ILP-plugin-http

@sharafian Can you help me understand the intended functionality around “multi-mode” delimiters in ilp-plugin-http? This comment is a bit unclear to me:

See README here:

outgoing.url: … if url contains a percent and the plugin is in multi mode, then segment after this plugin’s own address will be filled where the % when routing packets.

Basically we use this to attach a stateful set to a non-stateful deployment when using kubernetes. However it could also be used in any situation where you want to add many children to a plugin http instance with no connection logic required.

Imagine that the “Parent” is actually many connectors representing a single ILP connector, which therefore cannot keep state. The flow is as follows.

  • A new Child comes up (let’s say it’s running an SPSP server)
  • The Child does an ILDCP query to the Parent. It sends its ‘Name’ in a header, which is typically its ordinal index in a stateful set.
  • The Parent assigns the Child an address of Prefix + Name. So if the parent address is g.http the Child would be something like g.http.2. Note that this is a stateless operation; the Parent doesn’t save this ILP address anywhere.
  • Now the Child begins to answer to SPSP queries, giving its address of g.http.2. People begin sending to that address.
  • The Parent gets a packet for g.http.2. To decide where this packet goes, they take the first segment after its own address (2), and splices it into a URL. So lets say the stateful set for connector children is http://connetor-children, the URL of a child with ordinal 2 is http://connector-children-2 (this is in the rules of how stateful sets work)
  • The Parent splices the segment (2 in this example) into its outgoing url. Our outgoing URL in this example is http://connector-children-%.
  • The Child receives the packet correctly, and the Parent did not have to keep any state about its existence.
1 Like