tokio-rs / turmoil

Add hardship to your tests
MIT License
790 stars 50 forks source link

Supporting multiple network interfaces #134

Closed PetrichorIT closed 2 months ago

PetrichorIT commented 1 year ago

This PR changes:

relates to #132

mcches commented 1 year ago

Apologies for the delay in review. I have this queued up for tomorrow morning (08/15).

PetrichorIT commented 1 year ago

So in the spirit of breaking things, this PR fully supports multiple IP subnets, thus multiple bound addresses.

Changes

Open questions

Builder API

The node builder API is somewhat cumbersome, when creating very simple nodes. Notably build_client or build_host seems very verbose.

sim.node("my-simple-node").build_client(async { ... });

We could implement the API in such a way to allow these statements,

sim.client("my-simple-node").build(async { ... });
sim.host("my-simple-host").build(async { ... });

but that would use up the fn names Sim::client and Sim::host. Alternatively we could keep the original Sim::client / Sim::host as simple aliases to the fully qualified form.

mcches commented 1 year ago

I've not gotten the time to review this, many applogies. Another issue just came up that can provide further motivation for prioritizing this work.

See #153

progwriter commented 10 months ago

Hi folks, any update here?

This looks like a super useful feature for modeling systems in networking, where multi-interfaces are a must. Would be great to see this available in turmoil!

mcches commented 10 months ago

Hi folks, any update here?

This looks like a super useful feature for modeling systems in networking, where multi-interfaces are a must. Would be great to see this available in turmoil!

Thanks for checking in. This is low priority at the moment. I've got a decent refactor underway for the net modules and after that is in I can pick up contributing to this or guiding the changes.

Can you please elaborate on your use cases/requirements so that we take them into consideration?

progwriter commented 10 months ago

Can you please elaborate on your use cases/requirements so that we take them into consideration?

At a high level, doing some testing of a network routing protocol. Since the protocol uses a mix of tcp + udp, was hoping to use turmoil to remove networking non-determinism and enable contained testing + fault injection.

Being able to treat routers as having multiple interfaces is pretty important (for link-local and loopback-to-loopback communication)

mcches commented 2 months ago

Closing due to inactivity and because we need to refactor some core things for this to work.