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

Listening on IPv4 and IPv6 addresses #666

Closed
galexrt opened this issue Dec 17, 2022 · 7 comments · Fixed by #788
Closed

Listening on IPv4 and IPv6 addresses #666

galexrt opened this issue Dec 17, 2022 · 7 comments · Fixed by #788
Assignees
Labels
kind/feature New feature or request priority/high Issues that should be addressed as soon as possible.

Comments

@galexrt
Copy link

galexrt commented Dec 17, 2022

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

We have UDP based services that are able to run on IPv4 and IPv6 this helps users that have a "weak" IPv4 connectivity due to, e.g., their ISP providers lacking the IPv4 bandwidth (packet loss at the ISP's backbones as far as we have analyzed in most situations that we encountered).
For that we would like to run service accessible over IPv4 and IPv6.

Describe the solution you'd like

It would be great if quilkin had an option to listen on IPv4 and IPv6 addresses so users with a better IPv6 connectivity due to, e.g., ISP "uplink" limitations. Especially as quilkin seems to be capable to sending IPv4 traffic to IPv4 and IPv6 endpoints already from what I have read in the documentation and examples.

Describe alternatives you've considered

We can go IPv4-only but in the past even that has shown to cause some issues for "less optimized" services for users with ISPs that

@galexrt galexrt added the kind/feature New feature or request label Dec 17, 2022
@XAMPPRocky
Copy link
Collaborator

Thank you for your issue! This is something I definitely think we should add, and I’ve already been working on improving the code around here to make it easy to have multiple listeners in the the same process, and working on improving Quilkin’s Quality Of Service story and this feature definitely fits in that bill.

To me, the only thing to figure out is how to integrate it into Quilkin in a way that’s consistent with other features such as xds, and that makes it a compelling part of project. Here are some open questions I have of how it can integrate in Quilkin.

  • Is possible for this to be on by default and possibly not an option? While IPv6 still struggles to gain adoption in terms of network traffic, how reasonable is it for us to assume IPv6 support on machines that run Quilkin?
  • If in the future we allowed users to listen on multiple ports, with this “IP mirroring” feature. Would the feature be feature be “all port listeners are mirrored”, or would there be a motivating reason for having it be configured per listener?

@XAMPPRocky XAMPPRocky added the priority/high Issues that should be addressed as soon as possible. label Jan 25, 2023
@markmandel
Copy link
Member

markmandel commented Jun 15, 2023

Now that #752 is merged, @XAMPPRocky can you see any reason to not use the DualStackLocalSocket everywhere in Quilkin, and close this out?

quilkin/src/utils/net.rs

Lines 55 to 58 in 57244b4

pub struct DualStackLocalSocket {
v4: UdpSocket,
v6: UdpSocket,
}

@XAMPPRocky
Copy link
Collaborator

Nope, we should replace existing uses with this

@markmandel
Copy link
Member

Sounds good - I'll get on it.

@markmandel markmandel self-assigned this Jun 15, 2023
@markmandel
Copy link
Member

Just dropping a note to update - this will be my task for the next 0.7.0 release 👍🏻

@markmandel
Copy link
Member

Started work on this, so breaking things and trying to make it all work again 😄

markmandel added a commit to markmandel/quilkin that referenced this issue Aug 16, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Aug 16, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Aug 16, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Aug 17, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Aug 23, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
@markmandel
Copy link
Member

Final working piece is to work out the firewall rule:

The idea we had was to have multiple sources in the config:

version: v1alpha1
filters:
  - name: quilkin.filters.firewall.v1alpha1.Firewall
    config:
      on_read:
        - action: ALLOW
          sources: 
            - 192.168.51.0/24
            - ::1/128
          ports:
             - 10
             - 1000-7000

Then it also means that this reduces some boilerplate overall.

markmandel added a commit to markmandel/quilkin that referenced this issue Sep 6, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 12, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666

* Switch DualStackSocket over to being IPV6 only.
* Make tests run on --network=host so that ipv6 works
* Allow you to create a ipv4 dual stack socket. Only for testing.
* Firewall: Added sources type changes
* Looks like we got new types working!
* First step: Moved to multiple packets in test.
* Working out what to do with ipv4 mapped v6 values.
* Fixes for Firewall rules to handle ipv4 and ipv6, including ipv4 mapped ipv6 addresses
* update to docs for Firewall filter
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 14, 2023
Implemented the `DualStackLocalSocket` for the locally listening socket,
and updated the code base and fixed several issues that existed for
handling IPv6 addresses in the code base.

This included updating the `test_utils` framework to provide coverage in
tests for both ipv4 and ipv6 by allowing for either an IPv4 or IPv6
address to be created from the framework.

Closes googleforgames#666

* Switch DualStackSocket over to being IPV6 only.
* Make tests run on --network=host so that ipv6 works
* Allow you to create a ipv4 dual stack socket. Only for testing.
* Firewall: Added sources type changes
* Looks like we got new types working!
* First step: Moved to multiple packets in test.
* Working out what to do with ipv4 mapped v6 values.
* Fixes for Firewall rules to handle ipv4 and ipv6, including ipv4 mapped ipv6 addresses
* update to docs for Firewall filter
* AddressKind handles ipv6 formats better now.
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 14, 2023
Implemented the `DualStackLocalSocket` as a small newtype for IPv6
sockets that are configured to be able to send and receive ipv6 and ipv4
traffic on all platforms for the locally listening socket.

Updated the code base and docs and fixed several issues that
existed for handling IPv6 addresses in the code base, including updates
to the Firewall filter to be able to better manage ipv4 + ipv6 combo
rule sets.

Updated the `test_utils` framework to provide coverage in tests for
both ipv4 and ipv6 by allowing for either an IPv4 or IPv6 address to be
created from the framework.

Closes googleforgames#666
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 14, 2023
Implemented the `DualStackLocalSocket` as a small newtype for IPv6
sockets that are configured to be able to send and receive ipv6 and ipv4
traffic on all platforms for the locally listening socket.

Updated the code base and docs and fixed several issues that
existed for handling IPv6 addresses in the code base, including updates
to the Firewall filter to be able to better manage ipv4 + ipv6 combo
rule sets.

Updated the `test_utils` framework to provide coverage in tests for
both ipv4 and ipv6 by allowing for either an IPv4 or IPv6 address to be
created from the framework.

Closes googleforgames#666
XAMPPRocky pushed a commit that referenced this issue Sep 18, 2023
Implemented the `DualStackLocalSocket` as a small newtype for IPv6
sockets that are configured to be able to send and receive ipv6 and ipv4
traffic on all platforms for the locally listening socket.

Updated the code base and docs and fixed several issues that
existed for handling IPv6 addresses in the code base, including updates
to the Firewall filter to be able to better manage ipv4 + ipv6 combo
rule sets.

Updated the `test_utils` framework to provide coverage in tests for
both ipv4 and ipv6 by allowing for either an IPv4 or IPv6 address to be
created from the framework.

Closes #666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request priority/high Issues that should be addressed as soon as possible.
Projects
None yet
3 participants