SwitchBoard

From Adam Colton
Jump to navigation Jump to search

SwitchBoard is used to connect peers.

Structure

SwitchBoard is a DHT. A user connects through a gateway and then synchronises themselves to the DHT. Switchboard tracks who is connect and the information needed to connect to them (IP:Port and NAT Traversal data).

Service

As a local service, it can say if we're connected to another node. Search for another node. Connect to another node.

If we request to be connected to another node, it will return a messaging saying the request was received and is being processed. Later, it will return a message saying if the connection was successful or not.

Hole-Punching

I want to avoid using Hole Punching as much as possible - it's slow and annoying. But even if it were required everywhere, a small number of "gateways" could serve a huge number of users. Once a user is connected to one other peer, that peer can act as the STUN server for yet other peers. And so, any peer that can be discovered via the DHT can be reached via hole-punching (barring sym2sym).

Record

 Key: sha512(Val)
 Record: {
   Val: 64B,
   Service: 2B,
   ID: 64B,
 }

A bit abstract, but if I want some resource, I need to know what it's identifier. That's val. There may be a number of ways for me to get this resource. Each provider can register a service and ID to use on that service to request the resource.

The val cannot be requested though. You must have the Val to perform a put, but just the key to perform a get.

Problems

The key evenly distributes 'puts' but an attacker can look up a resource and then execute many malicious puts, a DOS for a single resource. We can partially protect against this because the attacker needs to know the value, but in some situations, they will.

This doesn't allow a user to directly register an onion route (the ID isn't big enough), so we'll end up needing a whole other service to do that unless we change ID to data and cap it at the size of a half-onion.

Message Passing

Messages will also move through the system. These include requests, nodes joining and nodes leaving.

Bandwidth

This is a challenge, a 1K message, once a second consumes 2.5G in a month.

DDOS

Even if we