Coder Social home page Coder Social logo

text's People

Contributors

irungentoo avatar jfreegman avatar jumbt avatar subliun avatar vikstrous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

text's Issues

How does tox decide how to contact a peer in the DHT?

How does tox decide if it should use TCP or UDP to contact a peer? When does it use a TCP replay to contact it indirectly? Maybe these questions will be answered in some of the docs that haven't been written yet?

Related question: Does tox ever use only one TCP node to relay all its traffic?

`nospam`'s entropy is important for security

The purpose of the onion routing is to hide the IP of the node that's advertising itself. However, when a node (A) advertises itself to what I'll call an introducer it sends it its public key. This introducer node now can pretend to be attempting to add A to its friends list because it knows its public key. The only protection is the nospam, which is 4 bytes. The size and randomness of the nospam is the only thing protecting A from having its IP discovered by a peer. This is not obvious from the nospam name. I think this property needs to be documented more clearly somewhere. Maybe this should go in the not-yet-written DHT documentation?

[Folder structure] .txt and readability?

The current folder structure contains an src_txt, md and latex folder, but all documents are under the src_txt folder not under md. Why you choose the .txt file format for the documentation?
I mean the .txt files are hard to read and md would be easier to read. This leads to the second question: what is the long term plan for this documentation? Is there any plan to convert the .txt files in .md files? Is there any plan to make a latex documentation?

[TCP_server] In what situation does this occur? [...]

https://github.com/Tox-Docs/Text/blob/master/src_text/TCP_server.txt#L11

Comment on

send data to friends who may not know that we are connected to the current TCP server while we know they are

found at column 650.

In what situation does this occur? Also, can this in theory be used for all communications, and the data packets are an optimisation, or are there limits to what can be sent via OOB (apart from the size limit)? It might make sense to increase that limit so that TCP clients can choose to use the less efficient OOB method to establish a connection once it runs out of connection IDs. It can later, when another connection is closed, establish a real connection and continue there.

DHT "friends"

https://github.com/Tox-Docs/Text/blob/master/src_text/DHT.txt#L77

What do you mean when you use the term "friend" in the context of the DHT? I thought that friend public keys are not DHT public keys, so there are no "friend" nodes in the DHT. Also, communicating to a friend requires finding their ip/port etc. over the onion protocol, doesn't it? I just don't understand the connection between the DHT and the concept of friends.

DHT traffic calculation

I did some calculations to see how well the current DHT algorithm scales in terms of bandwidth. I based the calculation on this:

Toxcore stores the 32 nodes closest to its DHT public key and 8 nodes closest to each of the public keys in its DHT friends list (or list of DHT public keys it actively tries to find and connect to) and pings them every 60 seconds to see if they are alive. It also sends get node requests to a random node in each of those lists of nodes every 20 seconds with the search public key being its public key for the closest node and the public key being searched for the ones in the DHT friends list. Nodes are removed after 122 seconds of no response. Nodes are only added to the lists after a valid ping response of send node packet is received from them.
. I assumed that the network is big enough that all of your friends have 4 unique closest nodes. These calculations are very much theoretical worst-case scenario numbers:

x = (32 max nodes in DHT + 8 nodes close to friends * num_friends)
x * 2 * ping(66) + x / 3 * (getnodes(113) + sendnodes(ipv4 238 ipv6 286)) = ? bytes/s
The first term is the pings per second

For 0 friends with all ipv4 nodes:
632 Bps

For 0 friends with all ipv6 nodes:
708 Bps

For 100 friends with all ipv6 nodes:
18428 Bps -> 18 kBps

For 100 friends with all ipv4 nodes:
16432 Bps -> 16 kBps

For 1000 friends with all ipv4 nodes:
158632 Bps -> 158 kBps

The assumption that all your friends have unique 4 closest friends is reasonable if the public keys are uniformly distributed (they better be) and your friends make up a small percent of the network. Someone should do the math to figure out the exact number taking into account probabilities, etc.

My conclusion from this exercise is that the DHT could use tuning if we expect users to have a lot of friends, but it's perfectly fine for up to 50-100 friends right now. I don't think most users have more than 10 actually. I think the network traffic usage would be a useful metric for ToxCore to expose for debugging purposes and so we can check how close to reality these numbers are.

[net_crypto] Please avoid this redundancy by abstracting out the cookie communication protocol basics. [...]

https://github.com/Tox-Docs/Text/blob/master/src_text/net_crypto.txt#L27

Comment on

Encrypted message is encrypted with sender's DHT private key, receiver's DHT public key and the nonce.

found at column 1.

Please avoid this redundancy by abstracting out the cookie communication protocol basics. Redundancy means I need to manually check that the same keys are used for both packets, because I must by default assume they are different.

Clarifications needed in onion.txt

Some sentences and paragraphs where I can't work out what you mean due to grammar/ambiguity:

  • line 163 ambiguous (does it contain sendback data AND a nonce?).
  • line 189 Use of equal needs clarification in this paragraph (particularly first sentence). It's hard to know what key you're referring to at each point.
  • line 205 bit explaining information for handling response needs to be clarified

[net_crypto] A TCP- like implementation not at the network level but at the net_crypto level? Which [...]

https://github.com/Tox-Docs/Text/blob/master/src_text/net_crypto.txt#L5

Comment on

work over UDP it must account for possible packet loss, packets arriving in the wrong order and has to implement some kind of congestion control.

found at column 30.

A TCP- like implementation not at the network level but at the net_crypto level? Which level is this packet loss coping mechanism implemented at?

Clarifications/Possible improvements in DHT.txt

-Line 16 - Unsure how clear it is how family numbers are presented in packed node (may be my own lack of knowledge)
-Line 16 -What sort of numbers on your machine represent 2 and 10? Are they used on other machines? A better reason for the document might look better.
-Line 42 - In last sentence think you mean the ping id that was sent in the ping request (in which case it should be THE 8 byte ping id) but didn't change as uncertain.
-Line 56 - Needs criteria for adding nodes to lists (good to make it obvious).
-Line 96 - Probably should outline how you check the NAT ping request is from a friend.

[DHT] Ping [...] and GetNodes are in concept an RPC service. [...]

https://github.com/Tox-Docs/Text/blob/master/src_text/DHT.txt#L34

Comment on

Send_nodes (response (for all addresses)):

found at column 1.

Ping (I'd like it to be called Echo, because that's exactly what it does: it replies with the exact same thing it received) and GetNodes are in concept an RPC service. I would like to see that reflected in the docs. Instead of a "GetNodes" and "SendNodes", make it a Nodes (RPC) service with a NodesRequest and a NodesResponse. This provides the reader with a higher level concept rather than just the packets. It also simplifies naming.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.