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