Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IP modes in connector and resolver #331

Open
GlenDC opened this issue Oct 3, 2024 · 4 comments
Open

Support IP modes in connector and resolver #331

GlenDC opened this issue Oct 3, 2024 · 4 comments
Assignees
Labels
easy An easy issue to pick up for anyone. good first issue Good for newcomers mentor available A mentor is available to help you through the issue.
Milestone

Comments

@GlenDC
Copy link
Member

GlenDC commented Oct 3, 2024

enum IpMode

  • dual (default)
  • singleIpV4
  • singleIpV6
  • dualPreferIpv4

Then wrapper types can be made:

  • DnsResolveIpMode(IpMode): control what Dns can resolve to
  • ConnectIpMode(IpMode): define what ip can connect to
@GlenDC GlenDC added this to the v0.3 milestone Oct 3, 2024
@GlenDC GlenDC added good first issue Good for newcomers easy An easy issue to pick up for anyone. mentor available A mentor is available to help you through the issue. labels Oct 3, 2024
@GlenDC
Copy link
Member Author

GlenDC commented Oct 19, 2024

These wrapper types are then to be used in the core tcp connector code, as to make sure we respect these desires when establishing a tcp connection.

@AnkurRathore
Copy link

@GlenDC I would like to work on this. let me know what I need to do to start contributing.

@GlenDC
Copy link
Member Author

GlenDC commented Oct 25, 2024

Hi @AnkurRathore , welcome and nice to meet you. It's all yours for now.

I can give you the high level steps that I would undertake if i would do it myself, but feel free to diviate where you see fit at your own best judgement:

  1. implement the enum types as I'll lay them out at end of my comment;
  2. use DnsResolveIpMode in
    async fn tcp_connect_inner<State, Dns, Connector>(
    to respect that enum (both to not resolve what shouldn't be resolved, and also to make it respect the preference. Because currently both IPv4 and IPv6 are allowed, and Ipv6 is currently always preferred (see delay))
  3. use ConnectIpMode in (a)
    let addr = (ip, port).into();
    to ensure we don't connect to IPv4/IPv6 if not desired, also use that same mode to overwrite DnsResolveIPMode in case ConnectIPMode is stricter. E.g. if IPv4 only is desired, than it's pointless to request Ipv6 addresses :)
enum DnsResolveIpMode
    dual (default)
    singleIpV4
    singleIpV6
    dualPreferIpv4

enum ConnectIpMode
    dual (default)
    ipv4
    ipv6

I do not know how good your rust or network knowledge is. So in case something is not clear now, or at any point, do feel free to ask. I'm here to mentor where you see fit. Also feel free to open a PR even if not yet "finished", in case you are stuck, want guidance or have questions of any other kind. I'm here. I do not always respond immediately, but I do promise I'll always get back to you eventually.

@AnkurRathore
Copy link

@GlenDC Thanks for including me. I have some experience in developing Software defined networking applications using Python. I have a basic knowledge about Rust and thought by improving that by getting involved in open source projects. I will be going through the Rama book and the source code to gain a better understanding. Will surely get back to you when stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy An easy issue to pick up for anyone. good first issue Good for newcomers mentor available A mentor is available to help you through the issue.
Projects
None yet
Development

No branches or pull requests

2 participants