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

Add a --force-p2p option for edge nodes #784

Open
RuofengX opened this issue Sep 14, 2021 · 11 comments
Open

Add a --force-p2p option for edge nodes #784

RuofengX opened this issue Sep 14, 2021 · 11 comments
Labels

Comments

@RuofengX
Copy link

RuofengX commented Sep 14, 2021

My question is, I have a supernode running on a vps with only 5Mbps bandwidth. I want my user could only use the p2p feature of n2n, supernode shouldn't forward any data stream in order to saving my cost of vps.
Is it possible adding a option named --force-p2p for edge? This could help a lot.

@Logan007
Copy link
Collaborator

Also is it possible adding a option named --force-p2p for edge?

This idea has been discussed from time to time; no final solution yet as far as I rememeber.

#344 #515 #614

@introspection3
Copy link
Contributor

Also is it possible adding a option named --force-p2p for edge?

This idea has been discussed from time to time; no final solution yet as far as I rememeber.

#344 #515 #614

may be,we can limit the speed

@lucktu
Copy link
Contributor

lucktu commented Sep 14, 2021

Support. actually, my issue could merge with this one.

I use zerotier now and then, just for comparison, and I think zerotier does better on p2p. that's why I said n2n didn't try hard enough.

@Logan007
Copy link
Collaborator

that's why I said n2n didn't try hard enough.

There probably are more methods to punch holes into NATs and firewalls. We only have the current ones implemented. But it does not mean that we are limited to those in the future. UPnP would already help some.

Support. actually, my issue could merge with this one.

Are you sure? I took your issue as plead for more and "stronger" hole-punching whereas this issue is more about "do not use the supernode even if available" for packet forwarding.

Also is it possible adding a option named --force-p2p for edge?

🤔 However, I have an idea how we might achieve something like "only use p2p for data packets, and not the supernode" without breaking the whole protocol... but I will need to test. I will let you know.

@lucktu
Copy link
Contributor

lucktu commented Sep 14, 2021

I agreed to the merger.

"only use p2p for data packets, and not the supernode", ok. supernode is just for shaking hands.

@Logan007
Copy link
Collaborator

I have just looked into it. It is not as easy to realize as I thought in the first place.

It would require way more changes than expected which I do not dare to make shortly before a possible release.

Main part still is PACKETs' role in hole punching process. We could rely on REGISTERs only – changing the whole protocol, not the packets themselves – but that would require to first build up (how?) and then keep connections alive between all peers all time, causing a lot of REGISTER traffic turning down scalability.

Also, please note that we will not completely get away from the supernode; broadcasts such as the essential ARP protocol always need to pass through the supernode.

@introspection3
Copy link
Contributor

@Logan007 you can limit the speed

@Logan007
Copy link
Collaborator

you can limit the speed

I am not too confident with this and would recommend to use well-approved tools such as tc to this extent. At the egde side, it could help to limit the bandwidth on the edge-supernode line without affecting any other connection.

@Logan007
Copy link
Collaborator

Considered answered, please re-open if required.

@lucktu lucktu mentioned this issue Nov 8, 2021
8 tasks
@ywnsya
Copy link

ywnsya commented Jul 7, 2022

In my humble opinion, a ForceP2P option could be added to Supernode, where Supernode only offers handshakes and all packets that need to be forwarded by Supernode will be dropped in order to reduce Supernode's traffic and broadband consumption, especially on some pay-per-traffic servers

@Logan007
Copy link
Collaborator

Logan007 commented Jul 7, 2022

The current n2n protocol actually uses also the forwarded data packets for hole punching, just dropping them unfortunately is no solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants