Gr4-packet-modem complete flowgraph

From GNU Radio
Revision as of 09:57, 22 August 2024 by Destevez (talk | contribs) (Created page with "This page describes the operation of a complete flowgraph that uses gr4-packet-modem and TUN Source/Sink blocks for IP communications. The Packet Transmitter and Packet Receiver blocks in this flowgraph are described in their respective pages gr4-packet-modem transmitter and gr4-packet-modem receiver. A flowgraph similar to this is used in each of the [https://github.com/daniestevez/gr4-packet-modem/tree/main/apps applications included in gr4-packet-modem]....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page describes the operation of a complete flowgraph that uses gr4-packet-modem and TUN Source/Sink blocks for IP communications. The Packet Transmitter and Packet Receiver blocks in this flowgraph are described in their respective pages gr4-packet-modem transmitter and gr4-packet-modem receiver.

A flowgraph similar to this is used in each of the applications included in gr4-packet-modem. Some applications use only the transmitter or the receiver part of the flowgraph, and some replace the SDR by a file or another block. See the README of the applications for more details.

Flowgraph

The flowgraph for the modem is shown below. Blocks in yellow are only present in burst mode, and blocks in blue are only present in stream mode.

Gr4 packet modem.png

In the transmitter section of the flowgraph, a TUN Source reads IP packets from a TUN network device. These IP packets are sent to the Packet Transmitter. The packets are marked with a tag that indicates that they are of type user data. When running in stream mode, the TUN Source also generates idle packets when there are no packets available in the the TUN device. Design note: ideally the insertion of idle packets would be placed on a block separated from TUN Source. However, due to the peculiarities of the GNU Radio 4.0 runtime, it is not possible to achieve good transmit latency if this is done, so all the functionality is integrated in the TUN Source as a work around. This is explained in more detail in the next section.

At the output of the Packet Transmitter there is either a Packet To Stream or a Packet Counter block depending on whether the transmitter is using burst or stream mode. The operation of these two blocks is described in the next section. In stream mode, the Packet To Stream block is used to convert between Pdu<std::complex<float>> packets which might be discontinuous in time (there can be time gap between each packet) to a continuous stream of std::complex<float> samples. It does so by inserting zeros in the output when no packet is available at the input, similarly to the GNU Radio 3.10 Burst to Stream block. In stream mode this conversion is not necessary, because the output is already a continuous stream of std::complex<float> samples.

The output IQ samples are sent to an SDR sink. At the moment such sink is not available in GNU Radio 4.0, so instead a File Sink and a FIFO are used to connect this flowgraph to a GNU Radio 3.10 flowgraph that contains the SDR sink.

In the transmitter section of the flowgraph, an SDR source introduces IQ samples into the flowgraph. Currently the only available SDR source in GNU Radio 4.0 is a Soapy Source block. These IQ samples are processed by the Packet Receiver, which only outputs packet payloads with correct CRC-32. A Packet Type Filter block is used to drop idle packets, according to a tag at the beginning of each packet that indicates the packet type (using information present in the packet header). The Tagged Stream To PDU converts from a stream of uint8_t items with packets delimited by "packet_len" tags to a stream of Pdu<uint8_t> packets, which is the required input format for TUN Sink. The TUN Sink writes all the received packets into a TUN network device.

Latency management