From f2c336e4f553f42262fd006b818ca965eeec789f Mon Sep 17 00:00:00 2001 From: irungentoo Date: Fri, 16 Aug 2013 20:02:53 -0400 Subject: Added docs detailing containing latest protocol changes. --- docs/updates/Symmetric-NAT-Transversal.md | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/updates/Symmetric-NAT-Transversal.md (limited to 'docs/updates/Symmetric-NAT-Transversal.md') diff --git a/docs/updates/Symmetric-NAT-Transversal.md b/docs/updates/Symmetric-NAT-Transversal.md new file mode 100644 index 00000000..49038216 --- /dev/null +++ b/docs/updates/Symmetric-NAT-Transversal.md @@ -0,0 +1,43 @@ +Notes: + +Friend requests need to be routed. + +The current DHT should be capable of punching all NATs except symmetric ones. + +###### + +Symmetric NAT hole punching: + +If we are not connected to the friend and if the DHT is queried and ips +returned for the friend are the same but the port is different, the friend is +assumed to be behind a symmetric NAT. + +Before attempting the procedure we first send a routed ping request to the +friend. This request is to be routed through the nodes who returned the ip of +the peer. + +As soon as we receive one routed ping request from the other peer, we respond +with a ping response. + +Ping request/response packet: +See: Crypto request packets in [[Crypto]] + +Message: +For the ping request: +[char with a value of 254][char with 0][8 byte random number] + +For the ping response: +[char with a value of 254][char with 1][8 byte random number (The same that was sent in the request)] + +As soon as we get a proper ping response from the other we run the different +ports returned by the DHT through our port guessing algorithm. + +###### + +Port guessing algorithm: + +Right now it just tries all the ports directly beside the known ports.(A better one is needed) + +###### + +We send DHT ping requests to all the guessed ports, only a couple at a time. -- cgit v1.2.3