MatrixAI / Relay

Service-Centric Networking for Matrix Automatons
0 stars 0 forks source link

Relay Service Abstraction and Addressing #3

Open ramwan opened 6 years ago

ramwan commented 6 years ago

Relay handles the networking aspects of automatons. Things that need to be examined are:

Service Discovery

Content and service addressing/naming

Context

Let there be a service A which needs to talk to a service B to work. A classic example would be a web server and a database.

A <---- message ----> B

We can have a few different structures to consider:

We also have multiple scenarios: (The following may not enumerate all scenarios.)

Purpose of service abstraction

The service abstraction would make all the issues listed above transparent for the automaton instance and developer. By making the service abstraction meaningful as well, we can allow the service name to be adaptable so changing specs and requirements can be easily accommodated.

What do we need the service abstraction to do?

ramwan commented 6 years ago

Things to look at:

Serval

https://github.com/MatrixAI/Relay/tree/master/papers/Serval Examination of Serval #9

Scion

Scion may be more to do with how to perform routing and discovery between services. https://github.com/MatrixAI/Relay/tree/master/papers/Scion

DNS/mDNS

mobile networking

ramwan commented 6 years ago

Notes on service discovery after a conversation with @CMCDragonkai

ramwan commented 6 years ago

Having examined Serval and Mobile IP, I'm going to create a simple scenario to test any design problems we may come across when using abstractions similar to those in Serval. This will test a stateless container responding to pings and then migrating to a different IP address, all transparent to the container sending pings.

ramwan commented 6 years ago

Initial experiment for service abstraction and addressing writeup @ https://github.com/MatrixAI/Relay/blob/master/experiments/stateless_container_ping_migrations/README.txt

The experiment follows roughly the proposal put forward by the Serval architecture albeit only for a single physical host. We have yet to see whether Serval's method of service discovery is necessary or not when scaling to a few physical hosts as well as potentially thousands of physical hosts.

@ the comment I made (2 comments above) about how DNS wasn't necessary, DNS could be a simple enough mechanism to use depending on automaton/service names. Discussed in the writeup.

Personally would say the service abstraction in Serval and mobile IP are all similar in the sense that they provide an extra level of indirection and the experiment shows that it does indeed work. Implementation details though will need to be sorted as discussed in the writeup.

CMCDragonkai commented 6 years ago

Our recent conversation discussed the use of content addressed automatons. Assume some deterministic input (Nix based expression, Content), and hash it, then truncate the hash according to how many bytes is required by IPv6 or IPv4. Make sure to avoid reserved IP addresses (or maybe this doesn't matter within a controlled isolated private network). This is similar to many LibP2P peer id: https://github.com/MatrixAI/hs-libp2p-peer

But basically the addresses also need to be generated relative to the protocol specification. If the session type dictates HTTP, then the address generation should be a dummy HTTP URI (however, there's no need to be random if we can make it deterministic and content addressed).