Live data from Hacker News

Rayfish, Peer-to-peer mesh VPN with no server to trust

rayfish.xyz

111–116 of 116 posts

Re: Rayfish, Peer-to-peer mesh VPN with no server to trust

#111
post #95
post #4

Earlier quoted context omitted.

With IPv6 it's plausible that you can avoid collisions as long as you use an expensive hash function, but for v4 how do you avoid IP collisions? With only 22 bits of entropy in your v4 addresses, you'll get accidental collisions with only ~2000 users.

Indeed. So what we do is build your ipv4 using private key bits + collision_index. It is not perfect but it has worked in our tests. We'll keep improving it. The collision_index is incremented when a collision happens on a network. Let's say you join network A, B, C. But when you join C, another peer has the same IP. The coordinator (which is a role anybody can have in the network) will not accept you in the network…

So I'd have a different IP on each network?

(I really hope "private key" was a typo of "public key"?)

Re: Rayfish, Peer-to-peer mesh VPN with no server to trust

#112
post #95

Earlier quoted context omitted.

Indeed. So what we do is build your ipv4 using private key bits + collision_index. It is not perfect but it has worked in our tests. We'll keep improving it. The collision_index is incremented when a collision happens on a network. Let's say you join network A, B, C. But when you join C, another peer has the same IP. The coordinator (which is a role anybody can have in the network) will not accept you in the network…

So I'd have a different IP on each network? (I really hope "private key" was a typo of "public key"?)

Indeed, it is a typo of `public key`. What I mean is that your identity is your private key. And no, you won't have a new IP per network. Your IP is `fnv1a(ip || index) when index > 0`. Which changes your IP in all of the networks. That's why we also implemented MagicDNS. You can just use your `user.ray` name. The daemon handles IP changes.

Re: Rayfish, Peer-to-peer mesh VPN with no server to trust

#113
post #112

Earlier quoted context omitted.

So I'd have a different IP on each network? (I really hope "private key" was a typo of "public key"?)

Indeed, it is a typo of `public key`. What I mean is that your identity is your private key. And no, you won't have a new IP per network. Your IP is `fnv1a(ip || index) when index > 0`. Which changes your IP in all of the networks. That's why we also implemented MagicDNS. You can just use your `user.ray` name. The daemon handles IP changes.

So every time you join a new network, your IP in the others can change?

Re: Rayfish, Peer-to-peer mesh VPN with no server to trust

#114
post #112

Earlier quoted context omitted.

Indeed, it is a typo of `public key`. What I mean is that your identity is your private key. And no, you won't have a new IP per network. Your IP is `fnv1a(ip || index) when index > 0`. Which changes your IP in all of the networks. That's why we also implemented MagicDNS. You can just use your `user.ray` name. The daemon handles IP changes.

So every time you join a new network, your IP in the others can change?

No, only once if there is a collision, which is 1/4M

Re: Rayfish, Peer-to-peer mesh VPN with no server to trust

#116
post #114

Earlier quoted context omitted.

No, only once if there is a collision, which is 1/4M

That's a "yes"

> So I'd have a different IP on each network?

NO. You will ONLY have to rotate your IP if you join a network in which there is a collision. 1 in 4 million chance. If that happens, it's ok. Ideally you are using magicDNS and don't have to worry about IPs or just use the IPv6.

Post reply on HN