From 59f83ee1a560a15179ef2b097b6f50fa76462d4f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 16 May 2021 21:58:11 +0200 Subject: [PATCH] Updated documentation --- docs/source/conf.py | 10 ++- docs/source/examples.rst | 54 ++++++++++++ docs/source/gettingstartedfast.rst | 6 +- docs/source/index.rst | 24 ++++-- docs/source/reference.rst | 58 ++++++++----- .../{overview.rst => understanding.rst} | 4 +- docs/source/whatis.rst | 84 +++++++++++++++++++ 7 files changed, 206 insertions(+), 34 deletions(-) rename docs/source/{overview.rst => understanding.rst} (99%) create mode 100644 docs/source/whatis.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 8784426..ba07a95 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,7 +32,7 @@ release = '0.2.0 β' # ones. extensions = [ 'sphinx.ext.autodoc', - 'sphinx.ext.autosectionlabel', + #'sphinx.ext.autosectionlabel', ] # Add any paths that contain templates here, relative to this directory. @@ -55,3 +55,11 @@ html_theme = 'classic' # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] + + +# def check_skip_member(app, what, name, obj, skip, options): +# print(what, " | ", name, " | ", obj, " | ", skip, " | ", options) +# return False + +# def setup(app): +# app.connect('autodoc-skip-member', check_skip_member) \ No newline at end of file diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 5e43ae2..10a0da0 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -1,3 +1,57 @@ +.. _examples-main: + ******** Examples ******** +A number of examples are included in the source distribution of Reticulum. +You can use these examples to learn how to write your own programs. + + +Minimal +======= +This example can be found at ``_. + +The *Minimal* example demonstrates the bare-minimum setup required to connect to +a Reticulum network from your program. In about five lines of code, you will +have the Reticulum Network Stack initialised, and ready to pass traffic in your +program. + +Announce +======== +This example can be found at ``_. + +The *Announce* example builds upon the previous example by exploring how to +announce a destination on the network, and how to let your program receive +notifications about announces from relevant destinations. + + +Broadcast +========= +This example can be found at ``_. + +The *Broadcast* example explores how to transmit plaintext broadcast messages +over the network. + +Echo +==== +This example can be found at ``_. + +The *Echo* example demonstrates communication between two destinations using +the Packet interface. + +.. _example-link: + +Link +==== +This example can be found at ``_. + +The *Link* example explores establishing an encrypted link to a remote +destination, and passing traffic back and forth over the link. + +Filetransfer +============ +This example can be found at ``_. + +The *Filetransfer* example implements a basic file-server program that +allow clients to connect and download files. The program uses the Resource +interface to efficiently pass files of any size over a Reticulum :ref:`Link`. \ No newline at end of file diff --git a/docs/source/gettingstartedfast.rst b/docs/source/gettingstartedfast.rst index acf0466..fddf6fd 100644 --- a/docs/source/gettingstartedfast.rst +++ b/docs/source/gettingstartedfast.rst @@ -24,9 +24,9 @@ started is to install Reticulum via pip: The above command will install Reticulum and dependencies, and you will be ready to import and use RNS in your own programs. The next step will most -likely be to look at some :ref:`Example Programs`. +likely be to look at some :ref:`Example Programs`. -Further information can be found in the :ref:`API Reference`. +Further information can be found in the :ref:`API Reference`. Participate in Reticulum Development @@ -69,4 +69,4 @@ don't use pip, but try this recipe: python3 Examples/Filetransfer.py -h When you have experimented with the basic examples, it's time to go read the -:ref:`Understanding Reticulum` chapter. \ No newline at end of file +:ref:`Understanding Reticulum` chapter. \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index f3fc843..1ea7bac 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,21 +1,33 @@ ************************************* Reticulum Network Stack Documentation ************************************* -Reticulum is a cryptography-based networking stack for wide-area networks built on readily available hardware, and can operate even with very high latency and extremely low bandwidth. Reticulum allows you to build very wide-area networks with off-the-shelf tools, and offers end-to-end encryption, autoconfiguring cryptographically backed multi-hop transport, efficient addressing, unforgeable packet acknowledgements and more. - -Reticulum is a complete networking stack, and does not use IP or higher layers, although it is easy to utilise IP (with TCP or UDP) as the underlying carrier for Reticulum. It is therefore trivial to tunnel Reticulum over the Internet or private IP networks. +Welcome to the documentation for Reticulum. This document aims to provide you +with all the information you need to understand Reticulum, develop programs +using it, or to participate in the development of Reticulum itself. +Table of Contents +================= .. toctree:: :maxdepth: 3 - :caption: Table of Contents: + whatis gettingstartedfast examples reference - overview + understanding -Indices and tables +Current Status +============== +Reticulum should currently be considered beta software. All core protocol features are implemented and functioning, but additions will probably occur as real-world use is explored. The API and wire-format can be considered relatively stable at the moment, but could change if warranted. + + +Caveat Emptor +============= +Reticulum is experimental software, and should be considered as such. While it has been built with cryptography best-practices very foremost in mind, it has not been externally security audited, and there could very well be privacy-breaking bugs. To be considered secure, Reticulum needs a very thourough security review by independt cryptographers and security researchers. If you want to help out, or help sponsor an audit, please do get in touch. + + +Indices and Tables ================== * :ref:`genindex` diff --git a/docs/source/reference.rst b/docs/source/reference.rst index a31dfa0..0f8a653 100644 --- a/docs/source/reference.rst +++ b/docs/source/reference.rst @@ -1,56 +1,68 @@ +.. _api-main: + ************* API Reference ************* This reference guide lists and explains all classes exposed by the RNS API. -Classes -======= -Communication over a Reticulum network in a program is acheived using a set of classes exposed by RNS. +Primary Interface Classes +========================= +Communication over a Reticulum network in a program is acheived using a set of +classes exposed by RNS. + +.. _api-reticulum: Reticulum --------- -.. automodule:: RNS - :members: Reticulum +.. autoclass:: RNS.Reticulum + :members: + + +.. _api-identity: Identity -------- -.. automodule:: RNS - :members: Identity - :noindex: +.. autoclass:: RNS.Identity + :members: + +.. _api-destination: Destination ----------- -.. automodule:: RNS - :members: Destination - :noindex: +.. autoclass:: RNS.Destination + :members: + +.. _api-packet: Packet ------ -.. automodule:: RNS - :members: Packet - :noindex: +.. autoclass:: RNS.Packet + :members: + +.. _api-link: Link ---- -.. automodule:: RNS - :members: Link - :noindex: +.. autoclass:: RNS.Link + :members: + +.. _api-resource: Resource -------- -.. automodule:: RNS - :members: Resource - :noindex: +.. autoclass:: RNS.Resource + :members: + +.. _api-transport: Transport --------- -.. automodule:: RNS - :members: Transport - :noindex: \ No newline at end of file +.. autoclass:: RNS.Transport + :members: \ No newline at end of file diff --git a/docs/source/overview.rst b/docs/source/understanding.rst similarity index 99% rename from docs/source/overview.rst rename to docs/source/understanding.rst index cc09a96..c147048 100644 --- a/docs/source/overview.rst +++ b/docs/source/understanding.rst @@ -1,7 +1,9 @@ +.. _understanding-main: + *********************** Understanding Reticulum *********************** -This document will briefly describe the overall purpose and operating principles of Reticulum, a +This chapter will briefly describe the overall purpose and operating principles of Reticulum, a networking stack designed for reliable and secure communication over high-latency, low-bandwidth links. It should give you an overview of how the stack works, and an understanding of how to develop networked applications using Reticulum. diff --git a/docs/source/whatis.rst b/docs/source/whatis.rst new file mode 100644 index 0000000..d5d9578 --- /dev/null +++ b/docs/source/whatis.rst @@ -0,0 +1,84 @@ +****************** +What is Reticulum? +****************** + +Reticulum is a cryptography-based networking stack for wide-area networks built on readily available hardware, and can operate even with very high latency and extremely low bandwidth. Reticulum allows you to build very wide-area networks with off-the-shelf tools, and offers end-to-end encryption, autoconfiguring cryptographically backed multi-hop transport, efficient addressing, unforgeable packet acknowledgements and more. + +Reticulum is a complete networking stack, and does not use IP or higher layers, although it is easy to utilise IP (with TCP or UDP) as the underlying carrier for Reticulum. It is therefore trivial to tunnel Reticulum over the Internet or private IP networks. Reticulum is built directly on cryptographic principles, allowing resilience and stable functionality in open and trustless networks. + +No kernel modules or drivers are required. Reticulum runs completely in userland, and can run on practically any system that runs Python 3. + + +What does Reticulum Offer? +========================== +* Coordination-less globally unique adressing and identification + +* Fully self-configuring multi-hop routing + +* Asymmetric RSA encryption and signatures as basis for all communication + +* Perfect Forward Secrecy on links with ephemereal Elliptic Curve Diffie-Hellman keys (on the SECP256R1 curve) + +* Reticulum uses the Fernet specification for encryption on links and to group destinations + + * AES-128 in CBC mode with PKCS7 padding + + * HMAC using SHA256 for authentication + + * IVs are generated through os.urandom() + +* Unforgeable packet delivery confirmations + +* A variety of supported interface types + +* An intuitive and easy-to-use API + +* Reliable and efficient transfer of arbritrary amounts of data + + * Reticulum can handle a few bytes of data or files of many gigabytes + + * Sequencing, transfer coordination and checksumming is automatic + + * The API is very easy to use, and provides transfer progress + + +Where can Reticulum be Used? +============================ +On practically any hardware that can support at least a half-duplex channel +with 1.000 bits per second throughput, and an MTU of 500 bytes. Data radios, +modems, LoRa radios, serial lines, AX.25 TNCs, amateur radio digital modes, +ad-hoc WiFi, free-space optical links and similar systems are all examples +of the types of interfaces Reticulum was designed for. + +An open-source LoRa-based interface called RNode has been designed +specifically for use with Reticulum. It is possible to build yourself, or it +can be purchased as a complete transceiver that just needs a USB connection +to the host. + +Reticulum can also be encapsulated over existing IP networks, so there's +nothing stopping you from using it over wired ethernet or your local WiFi +network, where it'll work just as well. In fact, one of the strengths of +Reticulum is how easily it allows you to connect different mediums into a +self-configuring, resilient and encrypted mesh. + +As an example, it's possible to set up a Raspberry Pi connected to both a +LoRa radio, a packet radio TNC and a WiFi network. Once the interfaces are +configured, Reticulum will take care of the rest, and any device on the WiFi +network can communicate with nodes on the LoRa and packet radio sides of the +network, and vice versa. + +Supported Interface Types and Devices +===================================== +Reticulum implements a range of generalised interface types that covers most of the communications hardware that Reticulum can run over. If your hardware is not supported, it's relatively simple to implement an interface class. Currently, the following interfaces are supported: + +* Any ethernet device + +* LoRa using `RNode `_ + +* Packet Radio TNCs, such as `OpenModem `_ + +* Any device with a serial port + +* TCP over IP networks + +* UDP over IP networks \ No newline at end of file