iduartgomez / simag

An experimental, under development, agent-based AI framework
Mozilla Public License 2.0
5 stars 2 forks source link

Add network agent architecture layer #13

Open iduartgomez opened 3 years ago

iduartgomez commented 3 years ago

This is a broad issue to track any work related to the network layer. This pertains to:

iduartgomez commented 3 years ago

For communication a P2P network should be implemented.

The preferred transport protocol for it's attributes is QUIC, currently there are some implementations of QUIC in Rust:

quinnis the highest level one, the proto subcrate would be on par with quiche as far as low level and can be used as a building block.

QUIC has some nice properties: efficient streams, native encryption, low latency and high throughput. This makes it ideal to build a RCP framework on-top of it which can be then used to handle communication between agents over a public network.

For peer routing Kademlia is the preferred data-structure/algorithm, libp2p.io has a working Rust implementation of it, as well as other useful building blocks. Unfortunately the QUIC protocol has not yet been added, although a PR is underway (libp2p/rust-libp2p#1334). Other building blocks that can be used from libp2p are the modules for peer discovery, streams, TLS. How could this be tied with quinn/quiche has to be explored (the undergoing PR uses quinn under the hood).

Other options: https://github.com/maidsafe/quic-p2p (does not seem mature enough?)

iduartgomez commented 3 years ago

Since transport layer is interchangable and libp2p transport protocols are implemented through traits could start working with tcp and move to QUIC later on.

iduartgomez commented 3 years ago

Some work done so far:

Ongoing: Groups, topic subscription and broadcasting.

The overall architecture is as follows:

Groups are an abstract type which denote a set of agents which share a feature in common. Groups are owned by one or more agents. Agents can (request) join, create or drop groups.