Closed PetrichorIT closed 2 months ago
Apologies for the delay in review. I have this queued up for tomorrow morning (08/15).
So in the spirit of breaking things, this PR fully supports multiple IP subnets, thus multiple bound addresses.
NodeIdentifier
, thus they always have a human-readable nameBuilder::ip_subnets
NodeBuilder::with_addr
or are automatically assigned in the node creation processNodeBuilder
API
Sim::client
and Sim::host
are still supported, but may be removedSim::client
and Sim::host
no longer support impl ToIpAddr
as input, only impl AsRef<str>
is supported, since every node needs are name (provided input is only used as a name, not longer as an addr)lookup
will no longer be used to register nodes (consider it read-only from now on)Dns::register
can be used to register new nodes in the DNS resolutiontrait ToIpAddr
, since all queries may return multiple IP addresstrait ToIpAddrs
, so no changes therefor_pairs
was replaced by for_connected_pairs
, since only IPs in the same subnet are connectedtrait ToSocketAddrs
can now return multiple addrsendpoints
keeps track of all addresses in one subnet, for easier node creation (maybe broadcast in the future?)net::tcp
and net::udp
bind / connect to appropriate addresses IpVersion
and Builder::ip_version
*_many
APIsThe 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.
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
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!
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?
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)
Closing due to inactivity and because we need to refactor some core things for this to work.
This PR changes:
NodeIdentifiers
to decouple node addresses and node identitiesIpSubnets
to model different subnets (subnets are not yet supported, see #132 for progress)1:n
mappings between names andIpAddr
indns.rs
ToIpAddr
traitrelates to #132