Comments (8)
We might still need a trait to support the regex use cases.
Yeah, but we can completly detach this trait from dns resolutions
from turmoil.
Linking #79 for context, and closing it to track in one place.
from turmoil.
I think we should set the goal as: Support multiple network interfaces. And then a piece of that is supporting subnets.
from turmoil.
Nodes, and thus Rt/Host can no longer by identified by a single IpAddr. The best possible solution would be to identify them by something like a MAC addr, but that would warrant major internal changes.
I think we should use a unique identifier for each host, which could be a uuid
. This would be an internal concept and our search capabilities would take string or IpAddr to resolve.
It'd be good to decouple the DNS "lookup" function from the network manipulation ones. So lookup
should always return one IpAddr or panic, but the others could resolve ids and and manipulate the network.
And then lastly, we need to change how hosts are added to the simulation to allow for different addressing schemes. Perhaps a builder pattern works best here:
sim.host()
.with_ipv4(...)
...
.build(<software>)
In terms of iterating on this we could create a new remote so that main
is available for bug fixes.
from turmoil.
It'd be good to decouple the DNS "lookup" function from the network manipulation ones. So lookup should always return one IpAddr or panic, but the others could resolve ids and and manipulate the network.
Since each node has two possible addresses, lookup
should return a set of addresses.
I think we should use a unique identifier for each host, which could be a uuid. This would be an internal concept and our search capabilities would take string or IpAddr to resolve.
And then lastly, we need to change how hosts are added to the simulation to allow for different addressing schemes. Perhaps a builder pattern works best here:
As an idea, if create a builder pattern like this,
sim.host(<name>)
...
.build(<software>)
we could ensure that each node has a human-readable name. Since these names should always be unique, we could them as a uuid
. This would more expressive than a simple numeric uuid
.
Additionally, we could change the API of the network manipulation functions like partition
to take in a set of nodenames instead of impl ToIpAddrs
, removing the need for that trait, and making the API overall simpler. This would also reduce the complexity of ToIpAddr
to be only used in simple dns lookups or APIs that internally use dns lookups like TcpStream::connect
.
Of course, reverse dns lookups would need to be publicly accessible, to indirectly allow network manipulation with IpAddrs
, but that should not be a problem.
from turmoil.
Since each node has two possible addresses, lookup should return a set of addresses.
Makes sense.
removing the need for that trait, and making the API overall simpler
We might still need a trait to support the regex use cases.
from turmoil.
Basically using ToIpAddr
for dns resultions, and something like ToNodeNames
for network manipulation
from turmoil.
I think a good first step would be the integration of uuids and the internal support of more complex dns queries.
See PR #134.
On a related note, will we ever support async dns queries (see #69)? I don't really see the point, since all queries in turmoil are sync either way. Additionally async lookups would prevent use of lookup in non-async contexts, like fn main
...
from turmoil.
Related Issues (20)
- support ephemeral port assignments HOT 1
- Implement additional UDP features HOT 1
- Fix AsyncRead impl for TcpStream
- Regex matching throws exception in Pair
- Question: Reproduce, Random and Time HOT 4
- meets Tokio `enble_io()` error HOT 4
- Return errors instead of panicking, when sending invalid packets. HOT 2
- Loopback is incomplete
- Error `ConnectionRefused` when binding UdpSocket to `localhost` HOT 2
- Spawn blocking blocking sim runtime HOT 1
- Infinitely running. HOT 2
- Fix socket close behavior when there is unread data
- Add support for SO_LINGER to `TcpStream`
- Add warning for blocking tasks that block the sim
- Support one-way partitions
- Enable testing of backpressure from TCP connections HOT 2
- Network partition should cause 'host unreachable' not 'connection refused' for TCP HOT 4
- Re-starting a crashed host with bounce panics
- More interesting examples of testing distribution system building blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turmoil.