Skip to content

Commit

Permalink
Added tl partial description
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Kaszubski committed Feb 8, 2019
1 parent cc1371c commit b0e6292
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/d2d/link_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
D2D - Link Layer setup
**********************

Layer 2: Link Layer overview
----------------------------
The **Link Layer** also called **Data Link Layer** is responsible for
transfering data between two devices. It defines how devices gain the
access to a medium. The **Link Layer** organizes data before
transmission and verifies whether the data were received or sent
successully. The best example of it could be a collision detection
feature - which is supported by the **D2D** libray. The **L2** plays
an important role in error detection and error recovering. In case
of an **UART** examplary implementation, **Link Layer** can detect
medium transmission errors such as **parity** or **overrun**, or
framing erros such as **CRC** mismatch.

How to setup
------------
After building a basic hardware connection between the Devices (Nodes),
Expand Down
50 changes: 50 additions & 0 deletions docs/d2d/transport_layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,54 @@ D2D - Transport Layer setup

Overview
--------
The **Transport Layer** is a layer 4 in the **OSI** model.
It is reponsible for providing end-to-end reliable communication
between two logical Nodes. This layer ensures the user that
data sent between the devices are correct and error-free.
The **L4** manages a traffic over the medium. It controls
a bandwidth by imposing speed reductions, controls
message re-transmissions in case of framing errors and
enusers data integrity such as maching a **Response** to
the **Query**.

How to setup
------------
There is no need to setup the **Transport Layer** and
after it's initialization it is ready to go. However, there
is one module on which the **L4** depends on. It is
a **Pseudo Random Number Generator** (**PRNG**) module.

Pseudo Random Number Generator setup
------------------------------------
The **Pseudo Random Number Generator** module is used by the
**Transport Layer** in order to generate random back-off times.
It requires a small setup for a target microcontroller. Required
setup can be done inside a ``prng_config.c/h`` files. Please take
a look at the ``prng_config.h`` API.

.. code-block:: C++
:linenos:

void prng_init_bit_generator(void);
void prng_start_bit_generator(void);
void prng_stop_bit_generator(void);
uint16_t prng_bit_generator_get(void);
int prng_delay(void);
void prng_seed(unsigned int x);

Each function contains a descriptive doxygen comment. It is
probably more interesting how to provide quick but reliable
implementation of the above functions.

The random bit generation can utilize an **ADC** microcontroller's
peripheral.


What next
---------
. . .


**Footnote**

**kaeraz**, 2019/02

0 comments on commit b0e6292

Please sign in to comment.