|
| 1 | +/*! \page page_packet_data Packet Data Transmission |
| 2 | + |
| 3 | +\section intro Introduction |
| 4 | + |
| 5 | +In many cases, the PHY layer of a digital transceiver uses <em>packets</em>to break |
| 6 | +down the transmission (as opposed to continuously broadcasting data), and GNU Radio |
| 7 | +natively supports this kind of transmission. The basic mechanisms which allow this |
| 8 | +are the \ref page_msg_passing and the \ref page_tagged_stream_blocks. |
| 9 | + |
| 10 | +With the tools provided in GNU Radio, simple digital packet transmission schemes |
| 11 | +are easily implemented, allowing the creation of packet-based communication links |
| 12 | +and even -networks. |
| 13 | + |
| 14 | +\section packetstructure Structure of a packet |
| 15 | + |
| 16 | +Typically, a packet consists of the following elements: |
| 17 | + |
| 18 | +- A preamble. This is used for detection, synchronization (in time and frequency) and possibly initial channel state estimation. |
| 19 | +- A header. This is of fixed length and stores information about the packet, such as (most importantly) its length, but potentially other information, such as the packet number, its intended recipient etc. |
| 20 | +- The payload. |
| 21 | +- A checksum, typically a CRC value, to validate the packet contents. |
| 22 | + |
| 23 | +At the transmitter stage, these are modulated and prepared for transmission (a forward error correction code may also be applied). Because the transmitter knows te packet length, is a trivial matter to create the transmit frames using the tagged stream blocks. |
| 24 | + |
| 25 | +The receiver has to perform a multitude of things to obtain the packet again. |
| 26 | +Most importantly, it has to convert an infinite stream (coming from the receiver |
| 27 | +device, e.g. a UHD source block) into a packetized, tagged stream. |
| 28 | + |
| 29 | +\section hpdemuxer The Header/Payload Demuxer and header parser |
| 30 | + |
| 31 | +The key element to return back to packetized state is the gr::digital::header_payload_demux. |
| 32 | +At its first input, it receives a continuous stream of sample data, coming from |
| 33 | +the receiver device. It discards all the incoming samples, until the beginning |
| 34 | +of a packet is signalled, either by a stream tag, or a trigger signal on its second input. |
| 35 | + |
| 36 | +Once such a beginning is detected, the demultiplexer copies the preamble and header |
| 37 | +to the first output (it must know the exact length of these elements). The header |
| 38 | +can then be demodulated with any suitable set of GNU Radio blocks. |
| 39 | + |
| 40 | +To turn the information stored in the demodulated header bits into metadata |
| 41 | +which can be understood by GNU Radio, a gr::digital::packet_headerparser_b block |
| 42 | +is used to turn the header data into a message, which is passed back to the |
| 43 | +header/payload demuxer. The latter then knows the length of the payload, and |
| 44 | +passes that out on the second output, along with all the metadata obtained |
| 45 | +in the header demodulation chain. |
| 46 | + |
| 47 | +The knowledge of the header structure (i.e. how to turn a sequence of bits into |
| 48 | +a payload length etc.) is stored in an object of type gr::digital::packet_header_default. |
| 49 | +This must be passed to the header parser block. |
| 50 | + |
| 51 | +\section ofdm Packet receiver example: OFDM |
| 52 | + |
| 53 | +\image html example_ofdm_packet_rx.png "Example: OFDM Packet Receiver" |
| 54 | + |
| 55 | +The image above shows an example of a simple OFDM receiver. It has no forward error correction, |
| 56 | +and uses the simplest possible frame structure. |
| 57 | + |
| 58 | +The four elements of the packet receiver are highlighted. The first part is the packet detector |
| 59 | +and synchronizer. The samples piped into the header/payload demuxer are fine frequency corrected, |
| 60 | +and a trigger signal is sent to mark the beginning of the burst. |
| 61 | + |
| 62 | +Next, the header demodulation receiver chain is activated. The FFT shifts OFDM symbols to the |
| 63 | +frequency domain. The coarse frequency offset and initial channel state are estimated from the |
| 64 | +preamble and are added to the stream as tags. The OFDM symbol containing the header is passed |
| 65 | +to an equalizer, which also corrects the coarse frequency offset. A serializer picks the data |
| 66 | +symbols from the OFDM symbol and outputs them as a sequence of scalar complex values, which |
| 67 | +are then demodulated into bits (in this case BPSK is used). |
| 68 | + |
| 69 | +The bits are interpreted by the header parser, which uses a gr::digital::packet_header_ofdm |
| 70 | +object to interpret the bits (the latter is derived form gr::digital::packet_header_default). |
| 71 | +The result from the header parser is then fed back to the demuxer, which now knows the length of |
| 72 | +payload and outputs that as a tagged stream. |
| 73 | + |
| 74 | +The payload demodulation chain is the same as the header demodulation chain, only the |
| 75 | +channel estimator block is unnecessary as the channel state information is still available |
| 76 | +as metadata on the payload tagged stream. |
| 77 | + |
| 78 | +This flow graph, as well as the corresponding transmitter, can be found in |
| 79 | +gr-digital/examples/ofdm/rx_ofdm.grc and gr-digital/examples/ofdm/tx_ofdm.grc |
| 80 | + |
| 81 | + |
| 82 | +*/ |
0 commit comments