📜 ⬆️ ⬇️

Netsukuku - your own internet



Recently, the habrasoobshchestvu quite actively discussed topics related to piracy, government tightening all sorts of nuts and other lawlessness. Discusses options for countering the policy of control, censorship and network deanonymization.

It is strange that against all this background there was not a single post about such an entertaining project as Netsukuku . The goal of which, no less than nothing, is to build your Internet with chess and administrators.
')
Rave? Not really.


Let's start with the basics. All our beloved Internet was originally created as a military system, to which stringent requirements for reliability and fault tolerance were imposed. Ideally, the network should work even after losing some of the nodes in the event of a nuclear war. Well, we already know that :)

In fact, everything closed on the bureaucracy. Being fault tolerant by nature, the network is based on backbone and centralized services like InterNIC, IANA, and depends entirely on them. For a long time, the Russian Internet was generally concentrated almost at one point (M9), the failure of which led to a network catastrophe several years ago.

In addition to purely technical problems, there are also political ones - each little defined state seeks, if not to control, then to control its traffic. In particularly neglected cases, this is expressed in the complete blockade of all content, except godly. Under the auspices of the fight against piracy, all sorts of laws are invented, which dissolve the hands of lawyers, special services and other pleasant offices. And the providers themselves are not at all eager to provide the user with the maximum convenience - both traffic is cut and ports are blocked.

Well?



In contrast to this, the hot Italian guys launched a project with a Japanese name - Netsukuku. This is a project to implement a fault-tolerant, distributed, self-organizing network, built on the basis of existing network technologies, such as TCP / IP and WiFi. The software itself is extremely undemanding of resources and can even run on embedded devices, such as access points and SOHO routers.

The main feature of this technology is that it allows you to build a network mesh with dynamic routing of up to 2,128 nodes (!). And to build it loudly said - just run a demon on the device, and the rest will happen automatically.

Unlike Freenet , N depends on the Internet only partially, and in the long term it can refuse it altogether. It should also be noted that Netsukuku operates at the 3rd level of the OSI model and involves building an independent physical data transmission network. That is, this is not another application protocol over the Internet, but an independent network.

Hmm ... And more?



So, in order. The basis of the entire Netsukuku network is a node. A node is a network device (an access point or a user's PC) with software running on it that provides routing. All nodes are peers, there is no difference between the user's end node and the router, which connects several adjacent subnets. The network itself involves the use of wireless technologies, as the most convenient in terms of scaling and connectivity.

As soon as the user launches the Netsukuku daemon on his device, his node starts throwing broadcast packets in order to detect neighbors. As soon as a neighbor is found, route information is exchanged, address assignment and other matters; after that, our client becomes a full member of the network and can immediately start using it - for user applications, everything happens completely ordinary and transparent.

From a technical point of view, this is a large lokalka with dynamic routing and its own name servers. Routing is provided by the daemon, steering the kernel routing table. The rest is as it is.

The key to the whole idea is the QSPN quantum routing protocol (Eng.) As well as the hierarchical network topology, which together provide a fast and computationally easy way to find a route between two arbitrary nodes that are close to the best in efficiency.

Network topology



Routing on the Internet is not easy. The backbone routers are monsters with a huge (in terms of home router) amount of memory and crazy performance. All because they are a bottleneck of the network - all regional traffic rushing through a limited number of channels. The choice of a suitable approach is carried out using complex algorithms on graphs. All this is not conducive to the simplicity of the construction of modern networks and their management.

If you try to build a network the size of the Internet using the “every-every-one” principle using conventional technologies, this would require huge memory costs, not to mention performance. Even if we stored only one route from one node to another, and even if this information occupied only one byte, then for the modern Internet (about 10 9 nodes) 1 gigabyte of memory would be required. On each node!

The Netsukuku network is built hierarchically: every 256 nodes are combined into a so-called. group node (gnode); 256 group nodes make up a higher order group (ggnode) and so on. Since each group node is the same full node of the network, the QSPN protocol can work the same way at all levels of the hierarchy. At the same time, when searching for a route, in each case it operates with a maximum of 256 nodes, which makes the search itself very easy.

Finally, the fractal approach is used to store the routes themselves - due to the high self-similarity of the network, it is possible to load all the information into only a few kilobytes (4K for 2 32 nodes).

Route detection and tracing



The basis of the QSPN protocol is the trace packet (TP). This is a package that contains the identifiers of the nodes through which it passed. This package is not sent to anyone specifically. Instead, a natural flood is arranged. When we say that “node A has sent a TP packet”, it means that “node A has started a treys flood”.

During the session, the packet packet passes each node only once. Having accepted TP, the node sends it to all its neighbors (of course, except for the source neighbor), adding itself to it. Once having participated in a flood session, the node will no longer forward incoming TPs belonging to the same flood.

Thus, it turns out that each node that receives a TP receives complete information about the route to the sender's node, as well as to each of the intermediary nodes. Since node A initially sends several TPs (to each of its immediate neighbors), at each moment in time, there are several versions of TP in the network belonging to the same flood, called “bouquet”.

An arbitrary node X, taking the first TP from node A and looking inside the package, suddenly gets the shortest route with the minimum RTT to node A, as well as all the nodes in the chain :) The subsequent packets that arrive will be alternative routes, respectively, longer. Thus, route information is collected automatically, and based on the actual network topology and delays.

The end of the first part



In conclusion, I would like to say a few words about the current state of affairs in the project. First, as the developers claim, the project is alive and well. At the moment, the documentation and the implementation of the demon on Python are written, which should replace the outdated version with C. Secondly, the full launch of the network has not yet been implemented, but I really hope that it will happen soon.

Information on the topic can be found on the official website of the project ; there is also a wiki , as well as a FAQ (+ Russian version )

PS:



Well, that's all for today :) I wanted to write more, but my eyes are already stuck together and my head does not understand.

In the next part, I will write in more detail about the types of routing packets and the important mechanism for resolving IP address collisions. A few words will be said about the naming system of hosts - an analogue of the usual DNS. It is also possible that there is enough space for network interaction with the Internet.

Of course, if you have questions and suggestions, you are welcome. I will try to answer. Yes, and more: I am not (yet?) The developer of this system and I do not imagine all the subtleties of the algorithms. But there is information and a desire to master it too.

Source: https://habr.com/ru/post/86702/


All Articles