n2n
n2n copied to clipboard
Add a --force-p2p option for edge nodes
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.
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
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
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.
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?
:thinking: 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.
I agreed to the merger.
"only use p2p for data packets, and not the supernode", ok. supernode is just for shaking hands.
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.
@Logan007 you can limit the speed
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.
Considered answered, please re-open if required.
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
The current n2n protocol actually uses also the forwarded data packets for hole punching, just dropping them unfortunately is no solution.