summaryrefslogtreecommitdiff
path: root/docs/Tox_middle_level_network_protocol.txt
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-18 22:00:12 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-18 22:00:12 -0400
commitdb3672bf3f3b8d2f04ba82c82f769732213cf685 (patch)
tree704a75f95f10127783dead70135a9510e2147687 /docs/Tox_middle_level_network_protocol.txt
parent9f6b17de55a31cf7aeb8370345849c30683f0c0c (diff)
Added text document explaining what needs to be done before TCP can be merged.
Diffstat (limited to 'docs/Tox_middle_level_network_protocol.txt')
-rw-r--r--docs/Tox_middle_level_network_protocol.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/Tox_middle_level_network_protocol.txt b/docs/Tox_middle_level_network_protocol.txt
new file mode 100644
index 00000000..ae0fd0f6
--- /dev/null
+++ b/docs/Tox_middle_level_network_protocol.txt
@@ -0,0 +1,41 @@
1The TCP client and TCP server part are in a state that can be considered
2feature complete. Why doesn't Tox support TCP yet even if those parts are
3complete?
4
5The answer is that a way to ensure a smooth switchover between the TCP and UDP
6needs to be added. If Tox first connects to the other user using TCP but then
7due to pure chance manages to connect using the faster direct UDP connection
8Tox must switch seamlessly from the TCP to the UDP connection without there
9being any data loss or the other user going offline and then back online. The
10transition must be seamless whatever both connected users are doing be it
11transferring files or simply chatting together.
12
13Possible evil/bad or simply TCP relays going offline must not impact the
14connection between both clients.
15
16Typically Tox will use more than one TCP relay to connect to other peers for
17maximum connection stability which means there must be a way for Tox to take
18advantage of multiple relays in a way that the user will never be aware if one
19of them goes offline/tries to slow down the connection/decides to corrupt
20packets/etc..
21
22To accomplish this Tox needs something between the low level protocol (TCP) and
23high level Tox messaging protocol hence the name middle level.
24
25The plan is to move some functionality from lossless_UDP to a higher level:
26more specifically the functionality for detecting which packets a peer is
27missing and the ability to request and send them again. lossless UDP uses plain
28text packets to request missing packets from the other peer while Tox is
29currently designed to kill the connection if any packet tampering is detected.
30This works very well when connecting directly with someone because if the
31attacker can modify packets it means he can kill your connection anyways. With
32TCP relays however that is not the case as such the packets used to request
33missing packets must be encrypted. If it is detected that a packet has been
34tampered, the connection must stay intact while the evil relay must be
35disconnected from and replaced with a good relay, the behavior must be the same
36as if the relay had just suddenly gone online. Of course something to protect
37from evil "friends" framing relays must also be implemented.
38
39Detailed implementation details:
40
41Coming soon.